|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ireasoning.protocol.snmp.SnmpOctetString
This class represents Snmp OCTET STRING data type. The OCTET STRING type represents arbitrary binary or textual data.
Field Summary |
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType |
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND |
Fields inherited from interface com.ireasoning.protocol.Msg |
ERROR_TYPE |
Constructor Summary | |
SnmpOctetString()
Constructs an empty SnmpOctetString object, whose toString() method should return "" just after construction. |
|
SnmpOctetString(byte[] data)
Constructs an SnmpOctetString object with the passed data. |
|
SnmpOctetString(SnmpOctetString s)
Makes a copy of passed in SnmpOctetString object |
|
SnmpOctetString(String data)
Constructs an SnmpOctetString object from passed data, whose toString() method should return a String equals to passed data just after construction. |
Method Summary | |
static String |
convertPhysAddress(String addr)
Converts passed physAddress to hex format. |
SnmpDataType |
copy()
Makes a copy of itself |
int |
encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
For internal use |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
static byte[] |
getBytes(String text)
Converts the passed String object, which is in hex format (The returned value of toHexString() method of this class, such as "0xAC 0x12 0xFF" ( or "0xAC 12 FF", or "0xAC12FF), each bytes separated by space), to byte array |
int |
getLength()
Returns the number of bytes of this octet string |
int |
getType()
Returns SnmpDataType.OCTETSTRING |
String |
getTypeString()
Returns "OctetString" |
byte[] |
getValue()
Returns byte array representation of this object |
int |
hashCode()
Returns a hash code value for the object |
void |
setValue(byte[] v)
Sets a new value |
String |
toHexString()
Returns hex format of this string. |
String |
toPrintableString()
Returns a String representation of this object. |
String |
toString()
Returns a String representation of this object. |
String |
toString(String charsetName)
Return a string decoded using the specified charset |
String |
toString2()
Returns a java String representation, even if this object contains non-displayable character |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SnmpOctetString()
public SnmpOctetString(String data)
public SnmpOctetString(byte[] data)
public SnmpOctetString(SnmpOctetString s)
Method Detail |
public int getLength()
public int getType()
getType
in interface SnmpDataType
public String getTypeString()
getTypeString
in interface SnmpDataType
public String toString()
toHexString()
method.
public String toString2()
toHexString()
public String toString(String charsetName) throws UnsupportedEncodingException
charsetName
- charsetName - The name of a supported charset
UnsupportedEncodingException
public String toPrintableString()
public String toHexString()
toString2()
,
toString()
public SnmpDataType copy()
SnmpDataType
copy
in interface SnmpDataType
public byte[] getValue()
public void setValue(byte[] v)
public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder) throws SnmpEncodingException
SnmpDataType
encode
in interface SnmpDataType
SnmpEncodingException
public boolean equals(Object obj)
SnmpDataType
equals
in interface SnmpDataType
public int hashCode()
SnmpDataType
hashCode
in interface SnmpDataType
public static byte[] getBytes(String text)
toHexString()
public static String convertPhysAddress(String addr)
addr
- MAC address, space or '-' are allowed
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |