|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java13.io.FilterInputStream
net.sf.jazzlib.CheckedInputStream
public class CheckedInputStream
InputStream that computes a checksum of the data being read using a supplied Checksum object.
Checksum
Field Summary |
---|
Fields inherited from class java13.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
CheckedInputStream(java.io.InputStream in,
Checksum sum)
Creates a new CheckInputStream on top of the supplied OutputStream using the supplied Checksum. |
Method Summary | |
---|---|
Checksum |
getChecksum()
Returns the Checksum object used. |
int |
read()
Reads one byte, updates the checksum and returns the read byte (or -1 when the end of file was reached). |
int |
read(byte[] buf,
int off,
int len)
Reads at most len bytes in the supplied buffer and updates the checksum with it. |
long |
skip(long n)
Skips n bytes by reading them in a temporary buffer and updating the the checksum with that buffer. |
Methods inherited from class java13.io.FilterInputStream |
---|
available, close, mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckedInputStream(java.io.InputStream in, Checksum sum)
Method Detail |
---|
public Checksum getChecksum()
getChecksum.getValue()
.
public int read() throws java.io.IOException
read
in class FilterInputStream
-1
if the end of the
stream is reached.
java.io.IOException
- if an I/O error occurs.java.io.FilterInputStream#in
public int read(byte[] buf, int off, int len) throws java.io.IOException
read
in class FilterInputStream
buf
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.
-1
if there is no more data because the end of
the stream has been reached.
java.io.IOException
- if an I/O error occurs.java.io.FilterInputStream#in
public long skip(long n) throws java.io.IOException
skip
in class FilterInputStream
n
- the number of bytes to be skipped.
java.io.IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |