public class Asn1OerEncodeBuffer extends Asn1EncodeBitBuffer
mByteIndex, mData, mTraceHandler
INITIAL_SIZE
context, mTypeCode
Constructor and Description |
---|
Asn1OerEncodeBuffer()
This constructor creates a OER encode buffer object with the
default initial size.
|
Asn1OerEncodeBuffer(int size)
This constructor creates a OER encode buffer object with the
given initial size.
|
Modifier and Type | Method and Description |
---|---|
Asn1OerEncodeBuffer |
beginSetOf()
If canonical mode is on, return a new Asn1OerEncodeBuffer into which the
repetitions of a SET OF can be encoded.
|
void |
binDump(java.io.PrintStream out,
java.lang.String varName)
This method dumps the encoded message in a human-readable format
to the given print output stream.
|
void |
encodeIdentifier(int ident)
Encode an identifier according to OER.
|
void |
encodeIntSigned(long value)
Encode an integer value as a variable length, signed integer, including
encoding the length, according to OER.
|
void |
encodeIntSigned(long value,
int octets)
Encode an integer value as a signed value (2's complement form), in
the given number of octets.
|
void |
encodeIntUnsigned(long value)
Encode an integer value as a variable length, unsigned integer, including
encoding the length, according to OER.
|
void |
encodeIntUnsigned(long value,
int octets)
Encode an integer value as an unsigned value (binary integer) in the
given number of octets.
|
void |
encodeLength(long length)
Encode an OER length determinant
|
void |
encodeQuantity(int quantity)
Encode an OER quantity (used for SEQUENCE-OF and SET-OF).
|
void |
encodeTag(short tagClass,
int tagNumber)
Encode a tag according to OER.
|
Asn1OerEncodeBuffer |
endSetOf()
If canonical mode is on, encode each of the SET OF occurrences, in sorted
order, to the original buffer, the one that created this buffer.
|
boolean |
getCanonicalMode()
Return true if canonical mode has been indicated by calling
setCanonicalMode(true);
|
int |
getIdentifierLength(int ident)
Return the minimal number of octets required to encode the given
identifier, where the identifier is encoded following the OER rules for
encoding a tag number greater than 62, i.e. in a variable number of
octets, with 7 bits of the value encoded in each octet and the first
bit serving as a flag bit.
|
Asn1OerEncodeBuffer |
newBuffer()
Return a new OER encode buffer with the same canonical mode setting as
this buffer.
|
void |
setCanonicalMode(boolean value)
Turn canonical mode on/off.
|
void |
setOfRepDone()
Invoke this method to signal to the buffer that another occurrence in
a SET OF has been completely encoded into it.
|
byteAlign, checkSize, copy, copy, encodeBit, encodeBits, encodeBits, encodeBits, encodeLongBits, encodeLongBits, getBitOffsetInByte, getBuffer, getByteArrayInputStream, getByteIndex, getMsgBitCnt, getMsgByteCnt, getMsgCopy, getMsgLength, getTraceHandler, hexDump, isByteAligned, reset, reverseBytes, setMsgBitCnt, toString, write, write, write, write
binDump, copy, encodeIntSigned, encodeIntUnsigned, getInputStream, getMinimalOctetsSigned, getMinimalOctetsUnsigned, getOutputStream, hexDump
addNamedEventHandler, getEventHandlerListCount, hasEventHandlers, invokeCharacters, invokeEndElement, invokeStartElement, setEventHandlerList
getContext, hexDump, hexDump, setKey, setTypeCode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInputStream
public Asn1OerEncodeBuffer()
public Asn1OerEncodeBuffer(int size)
size
- The initial size in bytes of an encode buffer.public void binDump(java.io.PrintStream out, java.lang.String varName)
binDump
in class Asn1EncodeBitBuffer
out
- stream to print to.varName
- Variable name to include in output.public Asn1OerEncodeBuffer beginSetOf()
public Asn1OerEncodeBuffer endSetOf()
public void setOfRepDone()
public final void encodeIntSigned(long value, int octets)
value
- The value to encode. It must fit in the given number of
octets.octets
- The number of octets to encode in; 0 < octets <= 8public final void encodeIntUnsigned(long value, int octets)
value
- The value to encode. It must be non-negative and fit in the
given number of octets.octets
- The number of octets to encode in; 0 < octets <= 8.public final void encodeIntSigned(long value)
value
- The value to encode.public final void encodeIntUnsigned(long value)
value
- The value to encode. It must be non-negative.public final void encodeLength(long length)
length
- public final void encodeQuantity(int quantity)
quantity
- public final int getIdentifierLength(int ident)
ident
- public final void encodeIdentifier(int ident)
ident
- The tag number.public final void encodeTag(short tagClass, int tagNumber)
tagClass
- The tag class. The highest 2 bits shall be set equal to
the bits specified in the encoding rules for the tag's class.
The remaining bits shall be zero. Asn1Tag.UNIV etc. fulfill this.tagNumber
- The tag number.public boolean getCanonicalMode()
public Asn1OerEncodeBuffer newBuffer()
public void setCanonicalMode(boolean value)