|
||||||||||
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.sibvisions.util.io.ByteCountInputStream
public class ByteCountInputStream
The ByteCountInputStream
is an InputStream
wrapper which counts read bytes
and also enables reading of expected bytes if known.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
ByteCountInputStream(java.io.InputStream pStream)
Creates a new instance of ByteCountInputStream . |
|
ByteCountInputStream(java.io.InputStream pStream,
long pExpectedBytes)
Creates a new instance of ByteCountInputStream for the given stream
and calculated number of expected bytes. |
Method Summary | |
---|---|
void |
close()
|
long |
getExpectedBytes()
Gets the expected bytes. |
long |
getReadBytes()
Gets the read bytes. |
long |
getSkippedBytes()
Gets the skipped bytes. |
int |
read()
|
int |
read(byte[] pContent,
int pOffset,
int pLength)
|
void |
readAvailableBytes()
If expected bytes count is set, this method will read the bytes which weren't read yet. |
long |
skip(long pBytes)
|
Methods inherited from class java.io.FilterInputStream |
---|
available, mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteCountInputStream(java.io.InputStream pStream)
ByteCountInputStream
.
pStream
- the wrapped streampublic ByteCountInputStream(java.io.InputStream pStream, long pExpectedBytes)
ByteCountInputStream
for the given stream
and calculated number of expected bytes.
pStream
- the wrapped streampExpectedBytes
- the number of expected bytesMethod Detail |
---|
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterInputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] pContent, int pOffset, int pLength) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public long skip(long pBytes) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
public void readAvailableBytes() throws java.io.IOException
java.io.IOException
- if reading bytes failedpublic long getReadBytes()
public long getSkippedBytes()
public long getExpectedBytes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |