public class BufferedByteCountInputStream
extends java.io.BufferedInputStream
Constructor and Description |
---|
BufferedByteCountInputStream(java.io.InputStream in)
Create a new instance with a default buffer size.
|
BufferedByteCountInputStream(java.io.InputStream in,
int size)
Create a new instance with a specific buffer size.
|
Modifier and Type | Method and Description |
---|---|
long |
getNumberOfBytesRead()
Get the number of bytes read.
|
int |
read()
Reads the next byte of data from this stream.
|
int |
read(byte[] b)
Reads up to byte.length bytes of data from this stream into an array of bytes.
|
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this stream into an array of bytes.
|
void |
resetNumberOfBytesRead()
Reset the number of bytes read to zero.
|
void |
setCallbackInterface(BufferedByteCountInputStreamCallbackInterface callbackInterface)
Set or unset the callback interface.
|
public BufferedByteCountInputStream(java.io.InputStream in)
in
- the underlying input streampublic BufferedByteCountInputStream(java.io.InputStream in, int size)
in
- the underlying input streamsize
- the buffer sizepublic void setCallbackInterface(BufferedByteCountInputStreamCallbackInterface callbackInterface)
callbackInterface
- the callback interface to set, or null to unset the callback interfacepublic int read() throws java.io.IOException
read
in class java.io.BufferedInputStream
java.io.IOException
- if an I/O error occurspublic int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
b
- the buffer into which the data is readjava.io.IOException
- if an I/O error occurspublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.BufferedInputStream
b
- the buffer into which the data is readoff
- the start offset in the bufferlen
- the maximum number of bytes readjava.io.IOException
- if an I/O error occurspublic long getNumberOfBytesRead()
public void resetNumberOfBytesRead()