|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream org.jaudiotagger.audio.asf.io.CountingInputStream
class CountingInputStream
This implementation of FilterInputStream
counts each read byte.
So at each time, with getReadCount()
one can determine how many
bytes have been read, by this classes read and skip methods (mark and reset
are also taken into account).
Field Summary | |
---|---|
private long |
markPos
If mark(int) has been called, the current value of
readCount is stored, in order to reset it upon reset() . |
private long |
readCount
The amount of read or skipped bytes. |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
CountingInputStream(java.io.InputStream stream)
Creates an instance, which delegates the commands to the given stream. |
Method Summary | |
---|---|
private void |
bytesRead(long amountRead)
Counts the given amount of bytes. |
long |
getReadCount()
|
void |
mark(int readlimit)
|
int |
read()
|
int |
read(byte[] destination,
int off,
int len)
|
void |
reset()
|
long |
skip(long amount)
|
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 markPos
mark(int)
has been called, the current value of
readCount
is stored, in order to reset it upon reset()
.
private long readCount
Constructor Detail |
---|
public CountingInputStream(java.io.InputStream stream)
stream
- stream to actually work with.Method Detail |
---|
private void bytesRead(long amountRead)
amountRead
- number of bytes to increase.public long getReadCount()
public void mark(int readlimit)
mark
in class java.io.FilterInputStream
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] destination, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
public long skip(long amount) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |