public final class ChecksumInputStream
extends org.apache.commons.io.input.CountingInputStream
Checksum value once the stream is exhausted or the count threshold is reached.
If the Checksum does not meet the expected value when exhausted, then the input stream throws an
IOException.
If you do not need the verification or threshold feature, then use a plain CheckedInputStream.
To build an instance, use ChecksumInputStream.Builder.
ChecksumInputStream.Builder| Modifier and Type | Class and Description |
|---|---|
static class |
ChecksumInputStream.Builder
Builds a new
ChecksumInputStream. |
ProxyInputStream.AbstractBuilder<T,B extends AbstractStreamBuilder<T,B>>in| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRead(int n)
Adds the number of read bytes to the count.
|
static ChecksumInputStream.Builder |
builder()
Constructs a new
ChecksumInputStream.Builder. |
long |
getRemaining()
Gets the byte count remaining to read.
|
getByteCount, resetByteCount, skipavailable, beforeRead, checkOpen, close, handleIOException, isClosed, mark, markSupported, read, read, read, reset, setReference, unwrapprotected void afterRead(int n)
throws IOException
CountingInputStreamafterRead in class org.apache.commons.io.input.CountingInputStreamn - number of bytes read, or -1 if no more bytes are availableIOException - Not thrown here but subclasses may throw.public static ChecksumInputStream.Builder builder()
ChecksumInputStream.Builder.ChecksumInputStream.Builder.public long getRemaining()