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.
Checksum
in
public CheckedInputStream(InputStream in, Checksum cksum)
Creates an input stream using the specified Checksum.
in
- the input stream
cksum
- the Checksum
public int read() throws IOException
Reads a byte. Will block if no input is available.
read
in class FilterInputStream
IOException
- if an I/O error has occurred
FilterInputStream.in
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.
read
in class FilterInputStream
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
NullPointerException
- If buf
is null
.
IndexOutOfBoundsException
- If off
is negative, len
is negative, or len
is greater than buf.length - off
IOException
- if an I/O error has occurred
FilterInputStream.in
public long skip(long n) throws IOException
Skips specified number of bytes of input.
skip
in class FilterInputStream
n
- the number of bytes to skip
IOException
- if an I/O error has occurred
public Checksum getChecksum()
Returns the Checksum for this input stream.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4