public class CountingInputStream extends FilterInputStream
FilterInputStream wrapper that counts the number of bytes read from the stream or skipped over
since the creation of this wrapper.| Constructor and Description |
|---|
CountingInputStream(InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
long |
getOffset()
Get the offset in the wrapped stream since the creation of this wrapper.
|
int |
read()
Reads the next byte of data from this input stream.
|
int |
read(byte[] b)
Reads up to byte.length bytes of data from this input stream into an array of bytes.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream into an array of bytes.
|
long |
skip(long n)
Skips over and discards n bytes of data from the input stream.
|
available, close, mark, markSupported, resetpublic CountingInputStream(InputStream is)
is - public int read()
throws IOException
read in class FilterInputStream-1 if the end of stream is reachedIOException - if an I/O error occurspublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamb - the buffer into which the data is readoff - the start offset in the buffer to write the datalen - the maximum number of bytes to read-1 if there
is no more data because the end of the stream has been reached.IOException - if an I/O error occurspublic int read(byte[] b)
throws IOException
read in class FilterInputStream-1 if there
is no more data because the end of the stream has been reached.IOException - if an I/O error occurspublic long skip(long n)
throws IOException
skip in class FilterInputStreamn - the number of bytes to be skippedIOException - if an I/O error occurspublic long getOffset()
Copyright © 2010 - 2020 Adobe. All Rights Reserved