Package org.mozilla.jss.asn1
Class CountingStream
java.lang.Object
java.io.InputStream
org.mozilla.jss.asn1.CountingStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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
FieldsModifier and TypeFieldDescriptionprivate int
private static final boolean
private int
private InputStream
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
close, nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
count
private int count -
markpos
private int markpos -
source
-
DEBUG
private static final boolean DEBUG- See Also:
-
-
Constructor Details
-
CountingStream
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
getNumRead
public int getNumRead() -
resetNumRead
public void resetNumRead()
-