|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.protocols.snmp.SnmpOctetString
public class 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. |
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. |
boolean |
equals(Object obj)
|
int |
getLength()
Returns the internal length of the octet string. |
byte[] |
getString()
Returns a reference to the internal object string. |
int |
hashCode()
|
void |
setString(byte[] data)
Sets the internal string array so that it is identical to the passed array. |
void |
setString(String data)
Sets the internal octet string equal to the converted stirng via the method getBytes(). |
static String |
toDisplayString(SnmpOctetString octetString)
This method takes an SnmpOctetString and replaces any unprintable characters with ASCII period ('.') and returns the resulting character string. |
static String |
toHexString(SnmpOctetString ostr)
|
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 |
|---|
finalize, getClass, 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(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 SnmpSyntaxbuf - 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 SnmpSyntaxbuf - 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 SnmpSyntaxpublic Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic static String toDisplayString(SnmpOctetString octetString)
octetString - SnmpOctetString from which to generate the String
public static String toHexString(SnmpOctetString ostr)
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||