| |
|
| java.lang.Object java.io.InputStream java.io.FilterInputStream java.util.zip.CheckedInputStream
CheckedInputStream | public class CheckedInputStream extends FilterInputStream (Code) | | An input stream that also maintains a checksum of the data being read.
The checksum can then be used to verify the integrity of the input data.
See Also: Checksum version: 1.28, 05/05/07 author: David Connelly |
Method Summary | |
public Checksum | getChecksum() Returns the Checksum for this input stream. | public int | read() Reads a byte. | public int | read(byte[] buf, int off, int len) Reads into an array of bytes. | public long | skip(long n) Skips specified number of bytes of input. |
CheckedInputStream | public CheckedInputStream(InputStream in, Checksum cksum)(Code) | | Creates an input stream using the specified Checksum.
Parameters: in - the input stream Parameters: cksum - the Checksum |
getChecksum | public Checksum getChecksum()(Code) | | Returns the Checksum for this input stream.
the Checksum value |
read | public int read() throws IOException(Code) | | Reads a byte. Will block if no input is available.
the byte read, or -1 if the end of the stream is reached. exception: IOException - if an I/O error has occurred |
read | public int read(byte[] buf, int off, int len) throws IOException(Code) | | Reads into an array of bytes. If len is not zero, the method
blocks until some input is available; otherwise, no
bytes are read and 0 is returned.
Parameters: buf - the buffer into which the data is read Parameters: off - the start offset in the destination array b Parameters: len - the maximum number of bytes read the actual number of bytes read, or -1 if the endof the stream is reached. exception: NullPointerException - If buf is null . exception: IndexOutOfBoundsException - If off is negative, len is negative, or len is greater than buf.length - off exception: IOException - if an I/O error has occurred |
skip | public long skip(long n) throws IOException(Code) | | Skips specified number of bytes of input.
Parameters: n - the number of bytes to skip the actual number of bytes skipped exception: IOException - if an I/O error has occurred |
|
|
|