public class Asn1PerDecodeBuffer extends Asn1DecodeBitBuffer implements Asn1PerMessageBuffer
mTraceHandlermByteCountcontext, mTypeCode| Constructor and Description |
|---|
Asn1PerDecodeBuffer(byte[] msgdata,
boolean aligned)
This constructor creates a PER decode buffer object that
references an encoded ASN.1 message.
|
Asn1PerDecodeBuffer(java.io.InputStream istream,
boolean aligned)
This constructor creates a PER decode buffer object that
references an encoded ASN.1 message.
|
| Modifier and Type | Method and Description |
|---|---|
void |
byteAlign()
This methods byte-aligns the buffer.
|
boolean |
decodeBit()
This method decodes a single bit value.
|
boolean |
decodeBit(java.lang.String ident)
This method decodes a single bit value.
|
int |
decodeBitsToInt(int nbits)
This method decodes bits from the input stream into a
standard integer value.
|
int |
decodeBitsToInt(int nbits,
java.lang.String ident)
This method decodes bits from the input stream into a
standard integer value.
|
long |
decodeBitsToLong(int nbits)
This method decodes bits from the input stream into a
long integer value.
|
long |
decodeBitsToLong(int nbits,
java.lang.String ident)
This method decodes bits from the input stream into a
long integer value.
|
void |
decodeBitsToOctetArray(byte[] value,
int offset,
int nbits)
This method decodes bits from the input stream into an array
of octets.
|
void |
decodeBitsToOctetArray(byte[] value,
int offset,
int bitOffset,
int nbits,
java.lang.String ident)
This method decodes bits from the input stream into an array
of octets.
|
void |
decodeBitsToOctetArray(byte[] value,
int offset,
int nbits,
java.lang.String ident)
This method decodes bits from the input stream into an array
of octets.
|
void |
decodeCharString(int nchars,
int abpc,
int ubpc,
Asn1CharSet charSet,
java.lang.StringBuffer sbuf)
This method decodes the contents of a known-multiplier
character string.
|
long |
decodeConsWholeNumber(long rangeValue)
This method implements the rules to decode a constrained whole
number as specified in section 10.5 of the X.691 standard.
|
long |
decodeConsWholeNumber(long rangeValue,
boolean retval,
java.lang.String ident)
This method implements the rules to decode a constrained whole
number as specified in section 10.5 of the X.691 standard.
|
long |
decodeConsWholeNumber(long rangeValue,
java.lang.String ident)
This method implements the rules to decode a constrained whole
number as specified in section 10.5 of the X.691 standard.
|
long |
decodeExtLength()
This method decodes an extension length value.
|
long |
decodeInt(int nocts,
boolean signExtend)
This method implements the rules to decode an unconstrained
integer value.
|
long |
decodeInt(int nocts,
boolean signExtend,
java.lang.String ident)
This method implements the rules to decode an unconstrained
integer value.
|
long |
decodeLength()
This method decodes either a constrained or unconstrained
length depending on whether a size constraint object is set
in this object.
|
long |
decodeLength(long lower,
long upper)
This method decodes a constrained length determinant value.
|
int |
decodeSmallLength()
This method implements the rules to decode a normally small length
as specified in section 11.9 of the X.691 standard.
|
int |
decodeSmallNonNegWholeNumber()
This method implements the rules to decode a small non-negative
whole number as specified in section 10.6 of the X.691 standard.
|
long |
decodeUnconsLength()
This method decodes a general (unconstrained) length
determinant value as described in section 10.9 of the 2008
X.691 standard.
|
boolean |
isAligned()
This method tests if PER alignment is turned on or off.
|
void |
setAligned(boolean value)
This method is used to turn PER aligned encoding on or off.
|
static Asn1PerDecodeBuffer |
setBuffer(Asn1PerDecodeBuffer buffer,
byte[] msgdata,
boolean aligned)
This method will create or reinitialize a PER decode message buffer
object to read data from the given byte array.
|
void |
setSizeConstraint(long lower,
long upper)
This method is used to set a size constraint within the
buffer object.
|
void |
setSizeConstraintExt(long lower,
long upper,
long extLower,
long extUpper)
This method is used to set an extensible size constraint within
the buffer object.
|
binDump, binDump, decodeBitsToOctetArray, getAvailableBits, getBitOffset, getBitOffsetInByte, getMsgBitCnt, getTraceHandler, hasMoreBits, mark, moveBitCursor, readByte, reset, setInputStream, skipBitsaddCaptureBuffer, capture, decodeIntValue, decodeOIDContents, decodeOIDContentsBig, decodeRelOIDContents, decodeRelOIDContentsBig, getByteCount, getInputStream, getLazyOpenTypeDecode, hexDump, init, read, read, read, read2Bytes, read4Bytes, removeCaptureBuffer, setLazyOpenTypeDecode, skip, skipOIDContents, skipRelOIDContentsaddNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerListgetContext, hexDump, hexDump, setKey, setTypeCodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputStream, getMsgBitCnt, getTraceHandlerpublic Asn1PerDecodeBuffer(byte[] msgdata,
boolean aligned)
msgdata - Byte array containing an encoded ASN.1 message.aligned - Boolean specifying PER aligned or unaligned encoding.public Asn1PerDecodeBuffer(java.io.InputStream istream,
boolean aligned)
istream - Input stream containing an encoded ASN.1 message.aligned - Boolean specifying PER aligned or unaligned encoding.public void byteAlign()
byteAlign in interface Asn1BitMessageBufferbyteAlign in class Asn1DecodeBitBufferpublic boolean decodeBit(java.lang.String ident)
throws Asn1EndOfBufferException,
java.io.IOException
ident - Bit field identifier name for tracing.Asn1EndOfBufferExceptionjava.io.IOExceptionpublic boolean decodeBit()
throws Asn1EndOfBufferException,
java.io.IOException
decodeBit in class Asn1DecodeBitBufferAsn1EndOfBufferExceptionjava.io.IOExceptionpublic long decodeBitsToLong(int nbits,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
nbits - Number of bits to decodeident - Bit field identifier name for tracing.Asn1Exceptionjava.io.IOExceptionpublic long decodeBitsToLong(int nbits)
throws Asn1Exception,
java.io.IOException
decodeBitsToLong in class Asn1DecodeBitBuffernbits - Number of bits to decodeAsn1Exceptionjava.io.IOExceptionpublic int decodeBitsToInt(int nbits,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
nbits - Number of bits to decodeident - Bit field identifier name for tracing.Asn1Exceptionjava.io.IOExceptionpublic int decodeBitsToInt(int nbits)
throws Asn1Exception,
java.io.IOException
decodeBitsToInt in class Asn1DecodeBitBuffernbits - Number of bits to decodeAsn1Exceptionjava.io.IOExceptionpublic void decodeBitsToOctetArray(byte[] value,
int offset,
int nbits,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
value - Octet array for decoded dataoffset - Starting byte offset into arraynbits - Number of bits to decodeident - Bit field identifier name for tracing, or null.Asn1Exceptionjava.io.IOExceptionpublic void decodeBitsToOctetArray(byte[] value,
int offset,
int bitOffset,
int nbits,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
value - Octet array for decoded dataoffset - Starting byte offset into arraybitOffset - Where in first byte the first bit goesnbits - Number of bits to decodeident - Bit field identifier name for tracing, or null.Asn1Exceptionjava.io.IOExceptionpublic void decodeBitsToOctetArray(byte[] value,
int offset,
int nbits)
throws Asn1Exception,
java.io.IOException
decodeBitsToOctetArray in class Asn1DecodeBitBuffervalue - Octet array for decoded dataoffset - Starting byte offset into arraynbits - Number of bits to decodeAsn1Exceptionjava.io.IOExceptionpublic void decodeCharString(int nchars,
int abpc,
int ubpc,
Asn1CharSet charSet,
java.lang.StringBuffer sbuf)
throws Asn1Exception,
java.io.IOException
nchars - Number of charactersabpc - Number of bits per character (aligned)ubpc - Number of bits per character (unaligned)charSet - Object representing the permitted alphabet
constraint character set (optional)sbuf - If not null, string buffer to receive decoded resultAsn1Exceptionjava.io.IOExceptionpublic long decodeConsWholeNumber(long rangeValue,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
rangeValue - upper - lower + 1. If a negative value is
passed, it will be interpreted as an unsigned
integer. If 0 is given, it will be interpreted
as 2^64.ident - Tracing identifierAsn1Exceptionjava.io.IOExceptionpublic long decodeConsWholeNumber(long rangeValue,
boolean retval,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
rangeValue - upper - lower + 1. If a negative value is
passed, it will be interpreted as an unsigned
integer. If 0 is given, it will be interpreted
as 2^64.retval - If true, return decoded adjusted value; else
return 0.ident - Tracing identifierAsn1Exceptionjava.io.IOExceptionpublic long decodeConsWholeNumber(long rangeValue)
throws Asn1Exception,
java.io.IOException
rangeValue - upper - lower + 1. If a negative value is
passed, it will be interpreted as an unsigned
integer. If 0 is given, it will be interpreted
as 2^64.Asn1Exceptionjava.io.IOExceptionpublic long decodeExtLength()
throws Asn1Exception,
java.io.IOException
Asn1Exceptionjava.io.IOExceptionpublic long decodeInt(int nocts,
boolean signExtend,
java.lang.String ident)
throws Asn1Exception,
java.io.IOException
nocts - Number of octets to decodesignExtend - Sign extend resulting value?ident - Tracing identifierAsn1Exceptionjava.io.IOExceptionpublic long decodeInt(int nocts,
boolean signExtend)
throws Asn1Exception,
java.io.IOException
nocts - Number of octets to decodesignExtend - Sign extend resulting value?Asn1Exceptionjava.io.IOExceptionpublic long decodeLength()
throws Asn1Exception,
java.io.IOException
Asn1Exceptionjava.io.IOExceptionpublic long decodeUnconsLength()
throws Asn1Exception,
java.io.IOException
Asn1Exceptionjava.io.IOExceptionpublic long decodeLength(long lower,
long upper)
throws Asn1Exception,
java.io.IOException
lower - Lower bound (inclusive) of length value rangeupper - Upper bound (inclusive) of length value rangeAsn1Exceptionjava.io.IOExceptionpublic int decodeSmallLength()
throws Asn1Exception,
java.io.IOException
Asn1Exceptionjava.io.IOExceptionpublic int decodeSmallNonNegWholeNumber()
throws Asn1Exception,
java.io.IOException
Asn1Exceptionjava.io.IOExceptionpublic boolean isAligned()
isAligned in interface Asn1PerMessageBufferpublic void setAligned(boolean value)
value - Boolean specifying PER aligned (true) or
unaligned encoding (false).public static Asn1PerDecodeBuffer setBuffer(Asn1PerDecodeBuffer buffer, byte[] msgdata, boolean aligned)
buffer - Existing message buffer objectmsgdata - Byte array containing message dataaligned - Boolean specifying PER aligned or unaligned encoding.public void setSizeConstraint(long lower,
long upper)
lower - Lower bound of root constraintupper - Upper bound of root constraintpublic void setSizeConstraintExt(long lower,
long upper,
long extLower,
long extUpper)
lower - Lower bound of root constraintupper - Upper bound of root constraintextLower - Lower bound of extension constraintextUpper - Upper bound of extension constraint