This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
java.util.zip
class CheckedInputStream
- All Implemented Interfaces:
- Closeable
public class CheckedInputStream
extends FilterInputStream
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.
Constructor Summary |
Creates an input stream using the specified Checksum.
|
Method Summary |
Checksum |
Returns the Checksum for this input stream.
|
int |
Reads a byte.
|
int |
read(byte[] buf, int off, int len)
Reads into an array of bytes.
|
long |
Skips specified number of bytes of input.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CheckedInputStream
public CheckedInputStream(InputStream in,
Checksum cksum)
-
Creates an input stream using the specified Checksum.
- Parameters:
in
- the input stream
cksum
- the Checksum
getChecksum
public Checksum getChecksum()
-
Returns the Checksum for this input stream.
- Returns:
- the Checksum value
read
public int read()
throws IOException
-
Reads a byte. Will block if no input is available.
- Overrides:
read
in class FilterInputStream
- Returns:
- the byte read, or -1 if the end of the stream is reached.
- Throws:
IOException
- if an I/O error has occurred
read
public int read(byte[] buf,
int off,
int len)
throws IOException
-
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.
- Overrides:
read
in class FilterInputStream
- Parameters:
buf
- the buffer into which the data is read
off
- the start offset in the destination array b
len
- the maximum number of bytes read
- Returns:
- the actual number of bytes read, or -1 if the end
of the stream is reached.
- Throws:
IOException
- if an I/O error has occurred
skip
public long skip(long n)
throws IOException
-
Skips specified number of bytes of input.
- Overrides:
skip
in class FilterInputStream
- Parameters:
n
- the number of bytes to skip
- Returns:
- the actual number of bytes skipped
- Throws:
IOException
- if an I/O error has occurred
This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
This page displays the
Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
The official Sun™ documentation can be found here at
http://java.sun.com/javase/6/docs/api/.