Save This Page
Home » openjdk-7 » com.sun.jmx » snmp » [javadoc | source]
com.sun.jmx.snmp
public class: BerDecoder [javadoc | source]
java.lang.Object
   com.sun.jmx.snmp.BerDecoder
The BerDecoder class is used for decoding BER-encoded data. A BerDecoder needs to be set up with the byte string containing the encoding. It maintains a current position in the byte string. Methods allows to fetch integer, string, OID, etc., from the current position. After a fetch the current position is moved forward. A fetch throws a BerException if the encoding is not of the expected type.

This API is a Sun Microsystems internal API and is subject to change without notice.

Field Summary
public static final  int BooleanTag     
public static final  int IntegerTag     
public static final  int OctetStringTag     
public static final  int NullTag     
public static final  int OidTag     
public static final  int SequenceTag     
Constructor:
 public BerDecoder(byte[] b) 
Method from com.sun.jmx.snmp.BerDecoder Summary:
cannotCloseSequence,   closeSequence,   fetchAny,   fetchAny,   fetchInteger,   fetchInteger,   fetchIntegerAsLong,   fetchIntegerAsLong,   fetchNull,   fetchNull,   fetchOctetString,   fetchOctetString,   fetchOid,   fetchOid,   getTag,   openSequence,   openSequence,   reset,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.jmx.snmp.BerDecoder Detail:
 public boolean cannotCloseSequence() 
    Return true if the end of the current sequence is not reached. When this method returns false, closeSequence can (and must) be invoked.
 public  void closeSequence() throws BerException 
    Close a sequence. The decode pull the stack and verifies that the current position matches with the calculated end of the sequence. If not it throws an exception.
 public byte[] fetchAny() throws BerException 
    Fetch an ANY value. In fact, this method does not decode anything it simply returns the next TLV as an array of bytes.
 public byte[] fetchAny(int tag) throws BerException 
    Fetch an ANY value with a specific tag.
 public int fetchInteger() throws BerException 
    Fetch an integer.
 public int fetchInteger(int tag) throws BerException 
    Fetch an integer with the specified tag.
 public long fetchIntegerAsLong() throws BerException 
    Fetch an integer and return a long value.
 public long fetchIntegerAsLong(int tag) throws BerException 
    Fetch an integer with the specified tag and return a long value.
 public  void fetchNull() throws BerException 
    Fetch a NULL value.
 public  void fetchNull(int tag) throws BerException 
    Fetch a NULL value with a specified tag.
 public byte[] fetchOctetString() throws BerException 
    Fetch an octet string.
 public byte[] fetchOctetString(int tag) throws BerException 
    Fetch an octet string with a specified tag.
 public long[] fetchOid() throws BerException 
    Fetch an object identifier.
 public long[] fetchOid(int tag) throws BerException 
    Fetch an object identifier with a specified tag.
 public int getTag() throws BerException 
    Get the tag of the data at the current position. Current position is unchanged.
 public  void openSequence() throws BerException 
    Fetch a sequence header. The decoder computes the end position of the sequence and push it on its stack.
 public  void openSequence(int tag) throws BerException 
    Fetch a sequence header with a specific tag.
 public  void reset() 
 public String toString()