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(InputStream inputStream,
MessageDigest messageDigest,
String digestHex)
Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
|
FSDigestInputStream(InputStream inputStream,
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
available, mark, markSupported, read, reset, skip
public FSDigestInputStream(InputStream inputStream, String digestHex) throws IOException
inputStream
- of type InputStreamdigestHex
- of type StringIOException
- if unable to get md5 digestpublic FSDigestInputStream(InputStream inputStream, MessageDigest messageDigest, String digestHex)
inputStream
- of type InputStreammessageDigest
- of type MessageDigestdigestHex
- of type Stringpublic int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public void seek(long pos) throws IOException
seek
in interface Seekable
seek
in class FSInputStream
IOException
public long getPos() throws IOException
getPos
in interface Seekable
getPos
in class FSInputStream
IOException
public boolean seekToNewSource(long targetPos) throws IOException
seekToNewSource
in interface Seekable
seekToNewSource
in class FSInputStream
IOException
Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.