|
|||||||||
| 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. |
| 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,
org.opennms.protocols.snmp.asn1.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,
org.opennms.protocols.snmp.asn1.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 |
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 self| Method 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,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
throws org.opennms.protocols.snmp.asn1.AsnEncodingException
encodeASN in interface SnmpSyntaxbuf - The buffer to write the encoded information.offset - The offset to start writing informationencoder - The encoder object.
org.opennms.protocols.snmp.asn1.AsnEncodingException - Thrown if the encoder finds an error in the
buffer.
public int decodeASN(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.AsnEncoder encoder)
throws org.opennms.protocols.snmp.asn1.AsnDecodingException
decodeASN in interface SnmpSyntaxbuf - The encode bufferoffset - The offset byte to begin decodingencoder - The decoder object.
org.opennms.protocols.snmp.asn1.AsnDecodingException - Thrown by the encoder if an error
occurs trying to decode the data buffer.public SnmpSyntax duplicate()
duplicate in interface SnmpSyntaxpublic java.lang.Object clone()
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||