| |
|
| java.lang.Object snmp.SNMPObject snmp.SNMPOctetString
All known Subclasses: snmp.SNMPNSAPAddress, snmp.SNMPIPAddress, snmp.SNMPBitString,
SNMPOctetString | public class SNMPOctetString extends SNMPObject (Code) | | Class representing a general string of octets.
|
Field Summary | |
protected byte[] | data | protected byte | tag |
Constructor Summary | |
public | SNMPOctetString() Create a zero-length octet string. | public | SNMPOctetString(String stringData) Create an octet string from the bytes of the supplied String. | public | SNMPOctetString(byte[] enc) Create an octet string from the supplied byte array. |
Method Summary | |
public boolean | equals(Object other) Checks the embedded arrays for equality. | protected void | extractFromBEREncoding(byte[] enc) | protected byte[] | getBEREncoding() Returns the BER encoding for the octet string. | public Object | getValue() Return the array of raw bytes. | public int | hashCode() Generates a hash value so SNMP Octet String subclasses can be used in Hashtables. | public void | setValue(Object data) Used to set the value from a byte array. | public String | toHexString() Returns a space-separated hex string corresponding to the raw bytes. | public String | toString() Returns a String constructed from the raw bytes. |
data | protected byte[] data(Code) | | |
SNMPOctetString | public SNMPOctetString()(Code) | | Create a zero-length octet string.
|
SNMPOctetString | public SNMPOctetString(String stringData)(Code) | | Create an octet string from the bytes of the supplied String.
|
SNMPOctetString | public SNMPOctetString(byte[] enc)(Code) | | Create an octet string from the supplied byte array. The array may be either
user-supplied, or part of a retrieved BER encoding. Note that the BER encoding
of the data of an octet string is just the raw bytes.
|
equals | public boolean equals(Object other)(Code) | | Checks the embedded arrays for equality.
|
extractFromBEREncoding | protected void extractFromBEREncoding(byte[] enc)(Code) | | |
getBEREncoding | protected byte[] getBEREncoding()(Code) | | Returns the BER encoding for the octet string. Note the the "value" part of the
BER type,length,value triple is just the sequence of raw bytes.
|
getValue | public Object getValue()(Code) | | Return the array of raw bytes.
|
hashCode | public int hashCode()(Code) | | Generates a hash value so SNMP Octet String subclasses can be used in Hashtables.
|
toHexString | public String toHexString()(Code) | | Returns a space-separated hex string corresponding to the raw bytes.
|
toString | public String toString()(Code) | | Returns a String constructed from the raw bytes. If the bytes contain non-printable
ASCII characters, tant pis! (Though it's fun when the bell rings!)
|
|
|
|