public final class CountingInputStream extends FilterInputStream
InputStream
that counts the number of bytes read.
initial count can be providedin
Constructor and Description |
---|
CountingInputStream(InputStream in,
long count)
Wraps another input stream, counting the number of bytes read.
|
Modifier and Type | Method and Description |
---|---|
long |
getCount()
Returns the number of bytes read.
|
void |
mark(int readlimit) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
String |
toString() |
available, close, markSupported, read
public CountingInputStream(@Nonnull InputStream in, long count)
in
- the input stream to be wrappedpublic long getCount()
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public long skip(long n) throws IOException
skip
in class FilterInputStream
IOException
public void mark(int readlimit)
mark
in class FilterInputStream
public void reset() throws IOException
reset
in class FilterInputStream
IOException
Copyright © 2018 SPF4J. All rights reserved.