com.adventnet.snmp.snmp2
Class SnmpBits

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.SnmpVar
        |
        +--com.adventnet.snmp.snmp2.SnmpString
              |
              +--com.adventnet.snmp.snmp2.SnmpBits

public class SnmpBits
extends SnmpString

Class of SNMP Bits Variable - Sub-class of SnmpString. This class can be used to create an object of type SnmpString. It also has methods to retrive the value in various forms(eg. String, byte).

See Also:
Serialized Form

Fields inherited from class com.adventnet.snmp.snmp2.SnmpString
byteValue, enc, s_emptyString, value
 
Fields inherited from class com.adventnet.snmp.snmp2.SnmpVar
Type, varbindErrorVal
 
Constructor Summary
(package private) SnmpBits()
           
  SnmpBits(byte[] b)
          Constructs a new SnmpBits by taking an octet string.
  SnmpBits(java.lang.String value, int radix)
          Constructs a new SnmpBits by taking a string value and the radix.
 
Method Summary
 java.lang.String getNumericValueAsString()
          This method will throw UnsupportedOperationException since this is not a numeric data type.
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpString
encode, equals, getVarObject, newInstance, toBytes, toByteString, toString, toTagString, toValue
 
Methods inherited from class com.adventnet.snmp.snmp2.SnmpVar
createVariable, getError, getType, getTypeString
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpBits

SnmpBits()

SnmpBits

public SnmpBits(byte[] b)
Constructs a new SnmpBits by taking an octet string. The first byte should contain the count of bits in the last byte, which are not relevant.

SnmpBits

public SnmpBits(java.lang.String value,
                int radix)
         throws SnmpException
Constructs a new SnmpBits by taking a string value and the radix. The radix can be either 2 or 16 which represents binary and hex respectively. Padding of zero's is done at the end of the string value, when the length of the given string is not a multiple of 8.
Method Detail

getNumericValueAsString

public java.lang.String getNumericValueAsString()
This method will throw UnsupportedOperationException since this is not a numeric data type.
Overrides:
getNumericValueAsString in class SnmpString
Returns:
Nothing is returned since this method throws an exception.
Throws:
java.lang.UnsupportedOperationException - Since this is not a numeric data type.