|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.util.zip.CheckedInputStream
public class CheckedInputStream
The CheckedInputStream class is used to maintain a running Checksum of all data read from a stream.
| Field Summary |
|---|
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
CheckedInputStream(InputStream is,
Checksum csum)
Constructs a new CheckedInputStream on InputStream is. |
|
| Method Summary | |
|---|---|
Checksum |
getChecksum()
Returns the Checksum calculated on the stream thus far. |
int |
read()
Reads a byte of data from the underlying stream and recomputes the Checksum with the byte data. |
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. |
long |
skip(long nbytes)
Skip upto nbytes of data on the underlying stream. |
| Methods inherited from class java.io.FilterInputStream |
|---|
available, close, mark, markSupported, read, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CheckedInputStream(InputStream is,
Checksum csum)
is - InputStream to calculate checksum fromcsum - Type of Checksum to calculate| Method Detail |
|---|
public int read()
throws IOException
read in class FilterInputStreamIOException - If the stream is already closed or another IOException
occurs.
public int read(byte[] buf,
int off,
int nbytes)
throws IOException
read in class FilterInputStreambuf - the byte array in which to store the read bytes.off - the offset in buffer to store the read bytes.nbytes - the maximum number of bytes to store in buffer.
IOException - If the stream is already closed or another IOException
occurs.public Checksum getChecksum()
public long skip(long nbytes)
throws IOException
skip in class FilterInputStreamnbytes - long Number of bytes to skip
IOException - If the stream is already closed or another IOException
occurs.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||