public class InputStreamTracker extends InputStream
Modifier and Type | Field and Description |
---|---|
private InputStream |
in
The source input stream to read from.
|
private long |
numRead
The number of bytes that has been read from the underlying
input stream so far.
|
private long |
numReadAtMark
The number of bytes that had been read when
mark(int)
was called. |
Constructor and Description |
---|
InputStreamTracker(InputStream in)
Create a new input stream tracker.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getNumRead()
Get the number of bytes read or skipped from the input stream.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
private final InputStream in
private long numRead
private long numReadAtMark
mark(int)
was called.public InputStreamTracker(InputStream in)
in
- The input stream to read frompublic int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException