java.lang.Object | |
↳ | com.sun.jmx.snmp.BerEncoder |
The BerEncoder
class is used for encoding data using BER.
A BerEncoder
needs to be set up with a byte buffer. The encoded
data are stored in this byte buffer.
NOTE : the buffer is filled from end to start. This means the caller needs to encode its data in the reverse order.
This API is a Sun Microsystems internal API and is subject to change without notice.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | BooleanTag | ||||||||||
int | IntegerTag | ||||||||||
int | NullTag | ||||||||||
int | OctetStringTag | ||||||||||
int | OidTag | ||||||||||
int | SequenceTag |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bytes | |||||||||||
stackBuf | |||||||||||
stackTop | |||||||||||
start |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new encoder and attaches it to the specified byte string.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Close a sequence.
| |||||||||||
Close a sequence with the specified tag.
| |||||||||||
Open a sequence.
| |||||||||||
Put an
ANY value. | |||||||||||
Put an
ANY value. | |||||||||||
Put an integer.
| |||||||||||
Put an integer expressed as a long.
| |||||||||||
Put an integer expressed as a long with the specified tag.
| |||||||||||
Put an integer with the specified tag.
| |||||||||||
Put a
NULL value with a specified tag. | |||||||||||
Put a
NULL value. | |||||||||||
Put an octet string.
| |||||||||||
Put an octet string with a specified tag.
| |||||||||||
Put an object identifier with a specified tag.
| |||||||||||
Put an object identifier.
| |||||||||||
Trim the encoding data and returns the length of the encoding.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Put an integer value expressed as a long.
| |||||||||||
Put an integer value and move the current position backward.
| |||||||||||
Put a length and move the current position backward.
| |||||||||||
Put an oid and move the current position backward.
| |||||||||||
Put a byte string and move the current position backward.
| |||||||||||
Put a tag and move the current position backward.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constructs a new encoder and attaches it to the specified byte string.
b | The byte string containing the encoded data. |
---|
Close a sequence. The decode pull the stack to know the end of the current sequence.
Close a sequence with the specified tag.
Open a sequence. The encoder push the current position on its stack.
Put an ANY
value. In fact, this method does not encode anything.
It simply copies the specified bytes into the encoding.
s | The encoding of the ANY value.
|
---|
Put an ANY
value. Only the first byteCount
are considered.
s | The encoding of the ANY value. |
---|---|
byteCount | The number of bytes of the encoding. |
Put an integer.
v | The integer to encode. |
---|
Put an integer expressed as a long.
v | The long to encode. |
---|
Put an integer expressed as a long with the specified tag.
v | The long to encode |
---|---|
tag | The tag to encode. |
Put an integer with the specified tag.
v | The integer to encode. |
---|---|
tag | The tag to encode. |
Put a NULL
value with a specified tag.
tag | The tag to encode. |
---|
Put a NULL
value.
Put an octet string.
s | The bytes to encode |
---|
Put an octet string with a specified tag.
s | The bytes to encode |
---|---|
tag | The tag to encode. |
Put an object identifier with a specified tag.
s | The integer to encode. |
---|---|
tag | The tag to encode. |
Put an object identifier.
s | The oid to encode. |
---|
Trim the encoding data and returns the length of the encoding.
The encoder does backward encoding : so the bytes buffer is
filled from end to start. The encoded data must be shift before
the buffer can be used. This is the purpose of the trim
method.
After a call to the trim
method, the encoder is reinitialized and putXXX
overwrite any existing encoded data.
Put an integer value expressed as a long.
v | The integer to encode. |
---|
Put an integer value and move the current position backward.
v | The integer to encode. |
---|
Put a length and move the current position backward.
length | The length to encode. |
---|
Put an oid and move the current position backward.
s | The oid to encode. |
---|
Put a byte string and move the current position backward.
s | The byte string to encode. |
---|
Put a tag and move the current position backward.
tag | The tag to encode. |
---|