class CountingInputStream
extends java.io.FilterInputStream
FilterInputStream
counts each read byte.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).Modifier and Type | Field and Description |
---|---|
private long |
markPos
|
private long |
readCount
The amount of read or skipped bytes.
|
Constructor and Description |
---|
CountingInputStream(java.io.InputStream stream)
Creates an instance, which delegates the commands to the given stream.
|
private long markPos
private long readCount
public CountingInputStream(java.io.InputStream stream)
stream
- stream to actually work with.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
Copyright © 2005-2013 java.net. All Rights Reserved.