@Beta @GwtIncompatible public final class CountingInputStream extends FilterInputStream
InputStream
that counts the number of bytes read.in
Constructor and Description |
---|
CountingInputStream(InputStream in)
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) |
available, close, markSupported, read
public CountingInputStream(InputStream in)
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 © 2010–2017. All rights reserved.