public abstract class Asn1DecodeBuffer extends Asn1MessageBuffer
Modifier and Type | Field and Description |
---|---|
protected int |
mByteCount |
context, mTypeCode
Modifier and Type | Method and Description |
---|---|
void |
addCaptureBuffer(java.io.ByteArrayOutputStream buffer)
This method is used to add a capture buffer to the internal
capture buffer list.
|
void |
capture(int nbytes)
This method captures bytes from the input stream to a separate
object for later analysis.
|
long |
decodeIntValue(int length,
boolean signExtend)
This method decodes the contents of an ASN.1 integer value.
|
int[] |
decodeOIDContents(int llen)
This method decodes the contents of an ASN.1 object identifier value.
|
java.math.BigInteger[] |
decodeOIDContentsBig(int llen)
This method decodes the contents of an ASN.1 object identifier value.
|
int[] |
decodeRelOIDContents(int llen)
This method decodes the contents of an ASN.1 relative object identifier value.
|
java.math.BigInteger[] |
decodeRelOIDContentsBig(int llen)
This method decodes the contents of an ASN.1 RELATIVE-OID value.
|
int |
getByteCount()
This method returns the count of bytes currently read from the
message being decoded.
|
java.io.InputStream |
getInputStream()
This method returns a reference to the current current decode
input stream object.
|
boolean |
getLazyOpenTypeDecode()
Return true if lazy open type decoding is on.
|
void |
hexDump()
This method provides a hex dump of the bytes in the message being
decoded.
|
protected void |
init()
This method initializes the input stream for decoding.
|
void |
mark(int readLimit)
This method is used to mark the current position in the input
stream for retry processing.
|
int |
read()
The read method reads a single byte from the current input stream
and returns it to the caller.
|
void |
read(byte[] buffer)
This version of the read method reads the number of bytes
equal to the length of the given input buffer.
|
void |
read(byte[] buffer,
int offset,
int nbytes)
This version of the read method reads the given number of bytes
from the current input stream and writes them to the specified
byte array at the given offset.
|
int |
read2Bytes()
Read the next two bytes from the current input stream into an int,
and return that int.
|
int |
read4Bytes()
Read the next four bytes from the current input stream into an int,
and return that int.
|
abstract int |
readByte()
This abstract method returns the next available 8-bit value
from the input stream.
|
void |
removeCaptureBuffer(java.io.ByteArrayOutputStream buffer)
This method is used to remove a capture buffer from the internal
capture buffer list.
|
void |
reset()
This method is used to reset the current position in the input
stream back to the location of the last 'mark' call.
|
void |
setInputStream(byte[] msgdata,
int offset,
int length)
This method will set the input stream from which data is read.
|
void |
setLazyOpenTypeDecode(boolean value)
This method turns lazy open type decoding on or off.
|
long |
skip(long nbytes)
This method will skip over the requested number of bytes in
the input stream.
|
void |
skipOIDContents(int llen)
This method skips the contents of an ASN.1 object identifier value.
|
void |
skipRelOIDContents(int llen)
This method skips past the contents of an ASN.1 relative object
identifier value.
|
addNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
getContext, hexDump, hexDump, setKey, setTypeCode
public void capture(int nbytes) throws Asn1EndOfBufferException, java.io.IOException
nbytes
- Number of bytes to captureAsn1EndOfBufferException
java.io.IOException
public long decodeIntValue(int length, boolean signExtend) throws Asn1Exception, java.io.IOException
length
- Length of encoded contentssignExtend
- Sign-extend the decoded value to form a 2's comp resultAsn1Exception
java.io.IOException
public final int[] decodeOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public final java.math.BigInteger[] decodeOIDContentsBig(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public final java.math.BigInteger[] decodeRelOIDContentsBig(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public final void skipOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public final int[] decodeRelOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public final void skipRelOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contentsAsn1Exception
java.io.IOException
public void addCaptureBuffer(java.io.ByteArrayOutputStream buffer)
buffer
- Buffer into which captured bytes are to be storedpublic void removeCaptureBuffer(java.io.ByteArrayOutputStream buffer)
buffer
- Buffer in which captured bytes storedpublic int getByteCount()
public java.io.InputStream getInputStream()
getInputStream
in class Asn1MessageBuffer
public boolean getLazyOpenTypeDecode()
public void hexDump()
protected void init()
public void mark(int readLimit)
readLimit
- Max number of bytes that can be read before mark
becomes invalid.public final int read2Bytes() throws Asn1EndOfBufferException, java.io.IOException
Asn1EndOfBufferException
- if at end-of-streamjava.io.IOException
- Java I/O errorpublic final int read4Bytes() throws Asn1EndOfBufferException, java.io.IOException
Asn1EndOfBufferException
- if at end-of-streamjava.io.IOException
- Java I/O errorpublic final int read() throws Asn1EndOfBufferException, java.io.IOException
Asn1EndOfBufferException
- if at end-of-streamjava.io.IOException
- Java I/O errorpublic abstract int readByte() throws Asn1Exception, java.io.IOException
Asn1Exception
java.io.IOException
public final void read(byte[] buffer, int offset, int nbytes) throws Asn1EndOfBufferException, java.io.IOException
buffer
- the buffer into which the data is readoffset
- the start offset of the datanbytes
- number of bytes to readAsn1EndOfBufferException
- if at end-of-streamjava.io.IOException
- Java I/O errorpublic void read(byte[] buffer) throws Asn1EndOfBufferException, java.io.IOException
buffer
- the buffer into which the data is readAsn1EndOfBufferException
- if at end-of-streamjava.io.IOException
- Java I/O errorpublic void reset()
public void setLazyOpenTypeDecode(boolean value)
public void setInputStream(byte[] msgdata, int offset, int length)
msgdata
- Byte array containing encoded message dataoffset
- Starting offset of data in the byte arraylength
- Length (in bytes) of the encoded datapublic long skip(long nbytes) throws java.io.IOException
nbytes
- Number of bytes to skipjava.io.IOException