|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.objsys.asn1j.runtime.Asn1MessageBufferBase com.objsys.asn1j.runtime.Asn1MessageBuffer com.objsys.asn1j.runtime.Asn1DecodeBuffer
public abstract class Asn1DecodeBuffer
This is the base class to specific decode buffer classes for the different types of encoding rules (BER, DER and PER).
Field Summary | |
---|---|
protected int |
mByteCount
|
Fields inherited from class com.objsys.asn1j.runtime.Asn1MessageBufferBase |
---|
context, mTypeCode |
Method Summary | |
---|---|
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. |
int[] |
decodeRelOIDContents(int llen)
This method decodes the contents of an ASN.1 relative object identifier 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. |
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 |
Field Detail |
---|
protected int mByteCount
Method Detail |
---|
public void capture(int nbytes) throws Asn1EndOfBufferException, java.io.IOException
nbytes
- Number of bytes to capture
Asn1EndOfBufferException
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 result
Asn1Exception
java.io.IOException
public int[] decodeOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contents
Asn1Exception
java.io.IOException
public int[] decodeRelOIDContents(int llen) throws Asn1Exception, java.io.IOException
llen
- Length of encoded contents
Asn1Exception
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-stream
java.io.IOException
- Java I/O errorpublic final int read4Bytes() throws Asn1EndOfBufferException, java.io.IOException
Asn1EndOfBufferException
- if at end-of-stream
java.io.IOException
- Java I/O errorpublic final int read() throws Asn1EndOfBufferException, java.io.IOException
Asn1EndOfBufferException
- if at end-of-stream
java.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 read
Asn1EndOfBufferException
- if at end-of-stream
java.io.IOException
- Java I/O errorpublic void read(byte[] buffer) throws Asn1EndOfBufferException, java.io.IOException
buffer
- the buffer into which the data is read
Asn1EndOfBufferException
- if at end-of-stream
java.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 skip
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |