|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.SnmpVar
com.adventnet.snmp.snmp2.SnmpBitstring
public class SnmpBitstring
Class of SNMP Bitstring Variable - Sub-class of SnmpVar. This class can be used to create an SnmpVar object of type SnmpString. It also has methods to retrive the value in different forms(eg. String, byte).
| Field Summary | |
|---|---|
(package private) byte[] |
byteValue
byteValue is the master value of the OCTETSTRING and is always valid The value of the octet string, never null |
(package private) static byte[] |
s_emptyString
immutable, hence shareable |
(package private) java.lang.String |
value
The String representation of the bit string. |
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
Type, varbindErrorVal |
| Constructor Summary | |
|---|---|
SnmpBitstring()
|
|
SnmpBitstring(byte[] b)
Constructs a new SnmpBitstring by taking an octet string. |
|
SnmpBitstring(byte[] b,
int size)
This takes a byte array and encodes. |
|
SnmpBitstring(java.lang.String val)
Constructs a new SnmpBitstring taking a string instance as its argument. |
|
| Method Summary | |
|---|---|
(package private) int |
encode(byte[] buff,
int space)
ASN encoder |
java.lang.String |
getNumericValueAsString()
This method will throw UnsupportedOperationException since this is not a numeric data type. |
java.lang.Object |
getVarObject()
Returns the value of this SnmpBitstring SNMP variable as a String Object. |
(package private) static SnmpVar |
newInstance(byte[] b)
Factory method for decode |
byte[] |
toBytes()
To return the value of this SnmpBitstring object as raw bytes. |
java.lang.String |
toString()
To convert the value of this SnmpBitstring object to a printable string used in printing variables. |
java.lang.String |
toTagString()
To convert the value of this SnmpBitstring object to a printable string where the type is tagged before the value with a tag BITSTRING:. |
java.lang.Object |
toValue()
Returns the value of this SnmpBitstring SNMP variable as a string object. |
| Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar |
|---|
createVariable, getError, getType, getTypeString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final byte[] s_emptyString
byte[] byteValue
java.lang.String value
| Constructor Detail |
|---|
SnmpBitstring()
public SnmpBitstring(java.lang.String val)
val - The string value for creating a new SnmpBitstring object.public SnmpBitstring(byte[] b)
public SnmpBitstring(byte[] b,
int size)
throws SnmpException
b - the byte array to be used.size - the length of the bit string
SnmpException - is thrown on invalid parameters such
as size less than the total number of bits in the array.| Method Detail |
|---|
static SnmpVar newInstance(byte[] b)
public java.lang.Object getVarObject()
getVarObject in class SnmpVarpublic java.lang.Object toValue()
toValue in class SnmpVarpublic java.lang.String toString()
toString in class SnmpVarpublic java.lang.String toTagString()
toTagString in class SnmpVarpublic byte[] toBytes()
toBytes in class SnmpVarpublic java.lang.String getNumericValueAsString()
getNumericValueAsString in class SnmpVarjava.lang.UnsupportedOperationException - Since this
is not a numeric data type.
int encode(byte[] buff,
int space)
throws java.lang.ArrayIndexOutOfBoundsException
encode in class SnmpVarjava.lang.ArrayIndexOutOfBoundsException - When there is
insufficient space in buffer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||