public class FSDigestInputStream extends FSInputStream
FSInputStream
implementation that can verify a
MessageDigest
and will count the number of bytes read for use in progress status.Constructor and Description |
---|
FSDigestInputStream(java.io.InputStream inputStream,
java.security.MessageDigest messageDigest,
java.lang.String digestHex)
Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
|
FSDigestInputStream(java.io.InputStream inputStream,
java.lang.String digestHex)
Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getPos() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
seek(long pos) |
boolean |
seekToNewSource(long targetPos) |
read, readFully, readFully
public FSDigestInputStream(java.io.InputStream inputStream, java.lang.String digestHex) throws java.io.IOException
inputStream
- of type InputStreamdigestHex
- of type Stringjava.io.IOException
- if unable to get md5 digestpublic FSDigestInputStream(java.io.InputStream inputStream, java.security.MessageDigest messageDigest, java.lang.String digestHex)
inputStream
- of type InputStreammessageDigest
- of type MessageDigestdigestHex
- of type Stringpublic int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void seek(long pos) throws java.io.IOException
seek
in interface Seekable
seek
in class FSInputStream
java.io.IOException
public long getPos() throws java.io.IOException
getPos
in interface Seekable
getPos
in class FSInputStream
java.io.IOException
public boolean seekToNewSource(long targetPos) throws java.io.IOException
seekToNewSource
in interface Seekable
seekToNewSource
in class FSInputStream
java.io.IOException
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.