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
 
Constructor Summary
private CountingStream()
           
  CountingStream(java.io.InputStream source)
           
 
Method Summary
 int available()
           
 int getNumRead()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] buffer)
           
 int read(byte[] buffer, int offset, int count)
           
 void reset()
           
 void resetNumRead()
           
 long skip(long count)
           
 
Methods inherited from class java.io.InputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

private int count

markpos

private int markpos

source

private java.io.InputStream source

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

CountingStream

private CountingStream()

CountingStream

public CountingStream(java.io.InputStream source)
Method Detail

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
java.io.IOException

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
Specified by:
read in class java.io.InputStream
java.io.IOException

read

public int read(byte[] buffer)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
java.io.IOException

read

public int read(byte[] buffer,
                int offset,
                int count)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
java.io.IOException

skip

public long skip(long count)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
java.io.IOException

getNumRead

public int getNumRead()

resetNumRead

public void resetNumRead()