|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.protocols.snmp.SnmpOctetString
Implements the ASN1.UNIVERSAL Octet String datatype. The string is a sequence of 8-bit octet data. The format of the 8-bit characters are defined by the application.
Field Summary | |
static byte |
ASNTYPE
The ASN.1 value for the OCTET STRING type. |
private byte[] |
m_data
The actual octet string data (UTF-8) |
(package private) static long |
serialVersionUID
Required to allow evolution of serialization format. |
Constructor Summary | |
SnmpOctetString()
The default class constructor. |
|
SnmpOctetString(byte[] data)
Constructs an octet string with the inital value equal to data. |
|
SnmpOctetString(SnmpOctetString second)
Class copy constructor. |
Method Summary | |
protected void |
assumeString(byte[] data)
This can be used by a derived class to force the data contained by the octet string. |
java.lang.Object |
clone()
Creates a duplicate copy of the object and returns it to the caller. |
int |
decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Decodes the ASN.1 octet string from the passed buffer. |
SnmpSyntax |
duplicate()
Creates a duplicate copy of the object and returns it to the caller. |
int |
encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Encodes the ASN.1 octet string using the passed encoder and stores the results in the passed buffer. |
int |
getLength()
Returns the internal length of the octet string. |
byte[] |
getString()
Returns a reference to the internal object string. |
void |
setString(byte[] data)
Sets the internal string array so that it is identical to the passed array. |
void |
setString(java.lang.String data)
Sets the internal octet string equal to the converted stirng via the method getBytes(). |
java.lang.String |
toString()
Returns a string representation of the object. |
byte |
typeId()
Returns the ASN.1 type identifier for the Octet String. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private byte[] m_data
public static final byte ASNTYPE
Constructor Detail |
public SnmpOctetString()
public SnmpOctetString(byte[] data)
data
- The data to be copied to selfpublic SnmpOctetString(SnmpOctetString second)
second
- The object to copy into selfMethod Detail |
protected void assumeString(byte[] data)
data
- The new data buffer.public byte[] getString()
public void setString(byte[] data)
data
- The new octet string data.public void setString(java.lang.String data)
data
- The new octet string data.String.getBytes()
public int getLength()
public byte typeId()
typeId
in interface SnmpSyntax
public int encodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnEncodingException
encodeASN
in interface SnmpSyntax
buf
- The buffer to write the encoded information.offset
- The offset to start writing informationencoder
- The encoder object.
AsnEncodingException
- Thrown if the encoder finds an error in the buffer.public int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- The encode bufferoffset
- The offset byte to begin decodingencoder
- The decoder object.
AsnDecodingException
- Thrown by the encoder if an error occurs trying to decode
the data buffer.public SnmpSyntax duplicate()
duplicate
in interface SnmpSyntax
public java.lang.Object clone()
public java.lang.String toString()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |