org.mozilla.jss.asn1
Class CountingStream
java.lang.Object
|
+--java.io.InputStream
|
+--org.mozilla.jss.asn1.CountingStream
- class CountingStream
- extends java.io.InputStream
This class keeps track of the number of bytes that have been read from
a stream. It will be incremented by the number of bytes read or skipped.
If the stream is marked and then reset, the number of bytes read will
be reset as well.
Field Summary |
private int |
count
|
private static boolean |
DEBUG
|
private int |
markpos
|
private java.io.InputStream |
source
|
Fields inherited from class java.io.InputStream |
SKIP_BUFFER_SIZE, skipBuffer |
Methods inherited from class java.io.InputStream |
close |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
count
private int count
markpos
private int markpos
source
private java.io.InputStream source
DEBUG
private static final boolean DEBUG
CountingStream
private CountingStream()
CountingStream
public CountingStream(java.io.InputStream source)
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
mark
public void mark(int readlimit)
- Overrides:
mark
in class java.io.InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class java.io.InputStream
read
public int read()
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
read
public int read(byte[] buffer)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
read
public int read(byte[] buffer,
int offset,
int count)
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
reset
public void reset()
throws java.io.IOException
- Overrides:
reset
in class java.io.InputStream
skip
public long skip(long count)
throws java.io.IOException
- Overrides:
skip
in class java.io.InputStream
getNumRead
public int getNumRead()
resetNumRead
public void resetNumRead()