com.objsys.asn1j.runtime
Class Asn1DerInputStream

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1MessageBufferBase
      extended by com.objsys.asn1j.runtime.Asn1MessageBuffer
          extended by com.objsys.asn1j.runtime.Asn1DecodeBuffer
              extended by com.objsys.asn1j.runtime.Asn1BerDecodeBuffer
                  extended by com.objsys.asn1j.runtime.Asn1DerDecodeBuffer
                      extended by com.objsys.asn1j.runtime.Asn1DerInputStream
All Implemented Interfaces:
Asn1InputStream

public class Asn1DerInputStream
extends Asn1DerDecodeBuffer
implements Asn1InputStream

This class handles the input stream for the decoding of ASN.1 messages as specified in the Distinguished Encoding Rules (DER) as documented in the ITU-T X.690 standard.


Field Summary
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1DecodeBuffer
mByteCount
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1MessageBufferBase
context, mTypeCode
 
Constructor Summary
Asn1DerInputStream(java.io.InputStream istream)
          This constructor creates a DER decode buffer object that references an encoded ASN.1 message.
 
Method Summary
 int available()
          Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream.
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 void mark(int readLimit)
          This method is used to mark the current position in the input stream for retry processing.
 boolean markSupported()
          Tests if this input stream supports the mark and reset methods.
 void reset()
          This method is used to reset the current position in the input stream back to the location of the last 'mark' call.
 long skip(long nbytes)
          This method will skip over the requested number of bytes in the input stream.
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1BerDecodeBuffer
calcIndefLen, decodeEnumValue, decodeEnumValue, decodeLength, decodeOpenType, decodeOpenType, decodeTag, decodeTagAndLength, getLastTag, matchTag, matchTag, matchTag, movePastEOC, parse, peekTag, peekTag, readByte
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1DecodeBuffer
addCaptureBuffer, capture, decodeIntValue, decodeOIDContents, decodeRelOIDContents, getByteCount, getInputStream, getLazyOpenTypeDecode, hexDump, init, read, read, read, read2Bytes, read4Bytes, removeCaptureBuffer, setInputStream, setLazyOpenTypeDecode
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1MessageBuffer
addNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1MessageBufferBase
getContext, hexDump, hexDump, setKey, setTypeCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asn1DerInputStream

public Asn1DerInputStream(java.io.InputStream istream)
This constructor creates a DER decode buffer object that references an encoded ASN.1 message. In this case, the message is passed in using an InputStream object.

Parameters:
istream - Input stream containing an encoded ASN.1 message.
Method Detail

available

public int available()
              throws java.io.IOException
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or or another thread.

Specified by:
available in interface Asn1InputStream
Returns:
the number of bytes that can be read from this input stream without blocking.
Throws:
java.io.IOException - if an I/O error occurs.

close

public void close()
           throws java.io.IOException
Closes this input stream and releases any system resources associated with the stream.

Specified by:
close in interface Asn1InputStream
Throws:
java.io.IOException - if an I/O error occurs.

mark

public void mark(int readLimit)
This method is used to mark the current position in the input stream for retry processing. It is equivalent to the Java InputStream 'mark' method.

Specified by:
mark in interface Asn1InputStream
Overrides:
mark in class Asn1DecodeBuffer
Parameters:
readLimit - Max number of bytes that can be read before mark becomes invalid.

markSupported

public boolean markSupported()
Tests if this input stream supports the mark and reset methods. The markSupported method of InputStream returns false.

Specified by:
markSupported in interface Asn1InputStream
Returns:
true if this true type supports the mark and reset method; false otherwise.

reset

public void reset()
This method is used to reset the current position in the input stream back to the location of the last 'mark' call. It is equivalent to the Java InputStream 'reset' method.

Specified by:
reset in interface Asn1InputStream
Overrides:
reset in class Asn1DecodeBuffer

skip

public long skip(long nbytes)
          throws java.io.IOException
This method will skip over the requested number of bytes in the input stream.

Specified by:
skip in interface Asn1InputStream
Overrides:
skip in class Asn1DecodeBuffer
Parameters:
nbytes - Number of bytes to skip
Throws:
java.io.IOException - if an I/O error occurs.