|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.tffenterprises.io.AccountingInputStream
public class AccountingInputStream
AccountingInputStream
is a FilterIntputStream
that implements the
AccountingInput
interface.
Field Summary | |
---|---|
private long |
consumed
Our register of written bytes. |
private long |
mark
Where the stream was last marked. |
private int |
readLimit
The read limit set by the mark() method. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
AccountingInputStream(java.io.InputStream in)
Constructor, the standard for a FilterInputStream subclass... |
Method Summary | |
---|---|
long |
consumed()
Returns the number of bytes that have been written to the stream or file since the AccountingOutput instance was constructed. |
void |
mark(int readLimit)
Mark the underlying stream for a later reset. |
int |
read()
Reads a single byte from this input stream. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes from the stream, copying them
starting at offset off to this byte array.. |
void |
reset()
Reset the underlying stream to the previously marked position. |
long |
skip(long n)
Skip over and discard n bytes from the input stream. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, markSupported, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private long consumed
private long mark
private int readLimit
Constructor Detail |
---|
public AccountingInputStream(java.io.InputStream in)
in
- the InputStream to encapsulateMethod Detail |
---|
public long consumed()
consumed
in interface AccountingInput
public int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the stream, copying them
starting at offset off
to this byte array..
read
in class java.io.FilterInputStream
b
- the byte array to which to copy bytes from the stream.off
- the offset at which to start writing bytes to b
.len
- the number of bytes to read from the stream
java.io.IOException
- if the underlying stream throws such an exception.public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
- if the underlying steram throws such an exception.public long skip(long n) throws java.io.IOException
n
bytes from the input stream.
skip
in class java.io.FilterInputStream
n
- the number of bytes to skip.
java.io.IOException
- if the underlying steram throws such an exception.public void mark(int readLimit)
mark
in class java.io.FilterInputStream
readLimit
- the maximum of bytes to remember.public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
- if the underlying steram throws such an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |