|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
schemajic.codec.ByteCountingInputStream
public class ByteCountingInputStream
Tracks the number of bytes read from an underlying input stream.
| Field Summary |
|---|
| Fields inherited from class java.io.BufferedInputStream |
|---|
buf, count, marklimit, markpos, pos |
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
ByteCountingInputStream(java.io.InputStream in)
Constructor for ByteCountingInputStream
with an input stream initialization value parameter. |
|
ByteCountingInputStream(java.io.InputStream in,
int size)
Constructor for ByteCountingInputStream
with input stream and a stream size initialization
value parameters. |
|
| Method Summary | |
|---|---|
byte[] |
getAccumulatedBytes()
Gets accumulated bytes read. |
int |
getBytesRead()
Gets the runing total of all bytes read. |
void |
mark(int readLimit)
Sets the current read mark to boolean
true, updates the old bytes read counter,
and sets the provided read mark limit. |
int |
read()
Reads a byte, counts it as read, and returns the byte to the caller. |
int |
read(byte[] b)
Reads a byte, counts it as read, conditionally writes the byte to an encoding, and returns the count of the bytes ptocessed to the caller. |
void |
reset()
Resets the byte counting operation. |
void |
startAccumulatingBytes()
Starts a counter to accumulate bytes read. |
void |
stopAccumulatingBytes()
Stops accumulating bytes. |
| Methods inherited from class java.io.BufferedInputStream |
|---|
available, close, markSupported, read, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteCountingInputStream(java.io.InputStream in)
ByteCountingInputStream
with an input stream initialization value parameter.
in - an input stream
public ByteCountingInputStream(java.io.InputStream in,
int size)
ByteCountingInputStream
with input stream and a stream size initialization
value parameters.
in - an input streamsize - input stream size| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.BufferedInputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.FilterInputStreamb - one byte
java.io.IOExceptionpublic int getBytesRead()
public void mark(int readLimit)
boolean
true, updates the old bytes read counter,
and sets the provided read mark limit.
mark in class java.io.BufferedInputStream
public void reset()
throws java.io.IOException
reset in class java.io.BufferedInputStreamjava.io.IOExceptionpublic void startAccumulatingBytes()
public byte[] getAccumulatedBytes()
throws java.io.IOException
java.io.IOException
public void stopAccumulatingBytes()
throws java.io.IOException
java.io.IOException
|
XCMS Toolkit | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||