| java.lang.Object java.io.InputStream java.io.FilterInputStream java.util.zip.CheckedInputStream
CheckedInputStream | public class CheckedInputStream extends java.io.FilterInputStream (Code) | | The CheckedInputStream class is used to maintain a running Checksum of all
data read from a stream.
|
Method Summary | |
public Checksum | getChecksum() Returns the Checksum calculated on the stream thus far. | public int | read() Reads a byte of data from the underlying stream and recomputes the
Checksum with the byte data. | public int | read(byte[] buf, int off, int nbytes) Reads up to nbytes of data from the underlying stream, storing it in buf,
starting at offset off. | public long | skip(long nbytes) Skip upto nbytes of data on the underlying stream. |
CheckedInputStream | public CheckedInputStream(InputStream is, Checksum csum)(Code) | | Constructs a new CheckedInputStream on InputStream is. The Checksum will
be calculated using the algorithm implemented by csum.
Parameters: is - InputStream to calculate checksum from Parameters: csum - Type of Checksum to calculate |
getChecksum | public Checksum getChecksum()(Code) | | Returns the Checksum calculated on the stream thus far.
A java.util.zip.Checksum |
read | public int read() throws IOException(Code) | | Reads a byte of data from the underlying stream and recomputes the
Checksum with the byte data.
-1 if end of stream, a single byte value otherwise |
read | public int read(byte[] buf, int off, int nbytes) throws IOException(Code) | | Reads up to nbytes of data from the underlying stream, storing it in buf,
starting at offset off. The Checksum is updated with the bytes read.
Number of bytes read, -1 if end of stream |
skip | public long skip(long nbytes) throws IOException(Code) | | Skip upto nbytes of data on the underlying stream. Any skipped bytes are
added to the running Checksum value.
Parameters: nbytes - long Number of bytes to skip Number of bytes skipped |
|
|