|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The AsnEncoder interface defines the contract that objects for encoding/decoding ASN.1 SNMP values must fulfill. The encoder must be able to encode and decode integers (unsigned and signed), object identifier, strings, and null values. To support the SNMPv2 the AsnEncoder class must also support encoding/decoding 64-bit integers. Currently the AsnEncoder interface only supports SNMPv1 types.
Method Summary | |
int |
buildHeader(byte[] buf,
int startOffset,
byte asnType,
int asnLength)
The buildHeader() method is used to encode an ASN.1 header into the specified byte buffer. |
int |
buildInteger32(byte[] buf,
int startOffset,
byte asnType,
int asnInt32)
The buildInteger32() method is used to encode an ASN.1 32-bit signed integer into the specified byte buffer. |
int |
buildLength(byte[] buf,
int startOffset,
int asnLength)
The buildLength() method is used to encode an ASN.1 length into the specified byte buffer. |
int |
buildNull(byte[] buf,
int startOffset,
byte asnType)
The buildNull() method is used to encode an ASN.1 NULL value into the specified byte buffer. |
int |
buildObjectId(byte[] buf,
int startOffset,
byte asnType,
int[] oids)
The buildObjectId() method is used to encode an ASN.1 object id value into the specified byte buffer. |
int |
buildString(byte[] buf,
int startOffset,
byte asnType,
byte[] opaque)
The buildString() method is used to encode an ASN.1 string value into the specified byte buffer. |
int |
buildUInteger32(byte[] buf,
int startOffset,
byte asnType,
long asnUInt32)
The buildUInteger32() method is used to encode an ASN.1 32-bit unsigned integer into the specified byte buffer. |
int |
buildUInteger64(byte[] buf,
int startOffset,
byte asnType,
java.math.BigInteger asnUInt64)
The buildUInteger64() method is used to encode an ASN.1 64-bit unsigned integer into the specified byte buffer. |
java.lang.Object[] |
parseHeader(byte[] buf,
int startOffset)
The parseHeader() method is used to decode an ASN.1 header from the specified buffer. |
java.lang.Object[] |
parseInteger32(byte[] buf,
int startOffset)
The parseInteger32() method is used to decode an ASN.1 32-bit signed integer from the specified buffer. |
java.lang.Object[] |
parseLength(byte[] buf,
int startOffset)
The parseLength() method is used to decode an ASN.1 length from the specified buffer. |
java.lang.Object[] |
parseNull(byte[] buf,
int startOffset)
The parseNull() method is used to decode an ASN.1 Null value from the specified buffer. |
java.lang.Object[] |
parseObjectId(byte[] buf,
int startOffset)
The parseObjectId() method is used to decode an ASN.1 Object Identifer from the specified buffer. |
java.lang.Object[] |
parseString(byte[] buf,
int startOffset)
The parseString() method is used to decode an ASN.1 opaque string from the specified buffer. |
java.lang.Object[] |
parseUInteger32(byte[] buf,
int startOffset)
The parseUInteger32() method is used to decode an ASN.1 32-bit unsigned integer from the specified buffer. |
java.lang.Object[] |
parseUInteger64(byte[] buf,
int startOffset)
The parseUInteger64() method is used to decode an ASN.1 64-bit unsigned integer from the specified buffer. |
Method Detail |
public int buildLength(byte[] buf, int startOffset, int asnLength) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnLength
- The length to be encoded.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseLength(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildHeader(byte[] buf, int startOffset, byte asnType, int asnLength) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferasnLength
- The length to be encoded.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseHeader(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildInteger32(byte[] buf, int startOffset, byte asnType, int asnInt32) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferasnInt32
- The 32-bit signed integer to encode.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseInteger32(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildUInteger32(byte[] buf, int startOffset, byte asnType, long asnUInt32) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferasnUInt32
- The 32-bit unsigned integer to encode.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseUInteger32(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildUInteger64(byte[] buf, int startOffset, byte asnType, java.math.BigInteger asnUInt64) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferasnUInt64
- The 64-bit unsigned integer to encode.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseUInteger64(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildNull(byte[] buf, int startOffset, byte asnType) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the buffer
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseNull(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildString(byte[] buf, int startOffset, byte asnType, byte[] opaque) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferopaque
- An array of bytes to encode into the string.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseString(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.public int buildObjectId(byte[] buf, int startOffset, byte asnType, int[] oids) throws AsnEncodingException
buf
- The output buffer of encoded bytes.startOffset
- The offset from the start of the buffer where the method
should start writing the encoded data.asnType
- The ASN.1 type to place in the bufferoids
- An array of integers to encode.
AsnEncodingException
- Thrown if an error occurs encoding the datatype.public java.lang.Object[] parseObjectId(byte[] buf, int startOffset) throws AsnDecodingException
buf
- The input bufferstartOffset
- The offset to start decoding in the buffer
AsnDecodingException
- Thrown if an error occurs decoding the buffer.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |