public class ChecksumInputStream extends FilterInputStream
in
Constructor and Description |
---|
ChecksumInputStream(InputStream stream,
Checksummer cksummer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the subsumed stream.
|
Checksummer |
getChecksummer()
Returns the Checksummer object.
|
long |
getNBytes()
Returns the byte count to date on the stream.
|
int |
read()
Reads a byte from the subsumed stream, updating
the byte count and the checksums.
|
int |
read(byte[] b)
Reads some number of bytes from the input stream and
stores them into the buffer array b.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the input stream
into an array of bytes.
|
long |
skip(long n)
Skips n bytes.
|
available, mark, markSupported, reset
public ChecksumInputStream(InputStream stream, Checksummer cksummer)
stream
- Stream to be filteredcksummer
- Object to calculate checksum on the bytes
as they are readpublic int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b) throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public long skip(long n) throws IOException
skip
in class FilterInputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterInputStream
IOException
public long getNBytes()
public Checksummer getChecksummer()
Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.