|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.management.snmp.BerDecoder
com.sun.management.snmp in
preference to classes in this package. This class may be removed
in a future version of Java DMK.
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.
| Field Summary | |
static int |
BooleanTag
Deprecated. |
static int |
IntegerTag
Deprecated. |
static int |
NullTag
Deprecated. |
static int |
OctetStringTag
Deprecated. |
static int |
OidTag
Deprecated. |
static int |
SequenceTag
Deprecated. |
| Constructor Summary | |
BerDecoder(byte[] b)
Deprecated. Constructs a new decoder and attaches it to the specified byte string. |
|
| Method Summary | |
boolean |
cannotCloseSequence()
Deprecated. Return true if the end of the current sequence is not reached. |
void |
closeSequence()
Deprecated. Close a sequence. |
byte[] |
fetchAny()
Deprecated. Fetch an ANY value. |
byte[] |
fetchAny(int tag)
Deprecated. Fetch an ANY value with a specific tag. |
int |
fetchInteger()
Deprecated. Fetch an integer. |
int |
fetchInteger(int tag)
Deprecated. Fetch an integer with the specified tag. |
long |
fetchIntegerAsLong()
Deprecated. Fetch an integer and return a long value. |
long |
fetchIntegerAsLong(int tag)
Deprecated. Fetch an integer with the specified tag and return a long value. |
void |
fetchNull()
Deprecated. Fetch a NULL value. |
void |
fetchNull(int tag)
Deprecated. Fetch a NULL value with a specified tag. |
byte[] |
fetchOctetString()
Deprecated. Fetch an octet string. |
byte[] |
fetchOctetString(int tag)
Deprecated. Fetch an octet string with a specified tag. |
long[] |
fetchOid()
Deprecated. Fetch an object identifier. |
long[] |
fetchOid(int tag)
Deprecated. Fetch an object identifier with a specified tag. |
int |
getTag()
Deprecated. Get the tag of the data at the current position. |
void |
openSequence()
Deprecated. Fetch a sequence header. |
void |
openSequence(int tag)
Deprecated. Fetch a sequence header with a specific tag. |
void |
reset()
Deprecated. |
String |
toString()
Deprecated. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
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 Detail |
public BerDecoder(byte[] b)
b - The byte string containing the encoded data.| Method Detail |
public void reset()
public int fetchInteger()
throws BerException
BerException - Current position does not point to an integer.
public int fetchInteger(int tag)
throws BerException
tag - The expected tag.
BerException - Current position does not point to an integer
or the tag is not the expected one.
public long fetchIntegerAsLong()
throws BerException
BerException - Current position does not point to an integer.
public long fetchIntegerAsLong(int tag)
throws BerException
tag - The expected tag.
BerException - Current position does not point to an integer
or the tag is not the expected one.
public byte[] fetchOctetString()
throws BerException
BerException - Current position does not point to an octet string.
public byte[] fetchOctetString(int tag)
throws BerException
tag - The expected tag.
BerException - Current position does not point to an octet string
or the tag is not the expected one.
public long[] fetchOid()
throws BerException
BerException
public long[] fetchOid(int tag)
throws BerException
tag - The expected tag.
BerException - Current position does not point to an oid
or the tag is not the expected one.
public void fetchNull()
throws BerException
NULL value.
BerException - Current position does not point to NULL value.
public void fetchNull(int tag)
throws BerException
NULL value with a specified tag.
tag - The expected tag.
BerException - Current position does not point to
NULL value or the tag is not the expected one.
public byte[] fetchAny()
throws BerException
ANY value. In fact, this method does not decode anything
it simply returns the next TLV as an array of bytes.
BerException - The next TLV is really badly encoded...
public byte[] fetchAny(int tag)
throws BerException
ANY value with a specific tag.
tag - The expected tag.
BerException - The next TLV is really badly encoded...
public void openSequence()
throws BerException
BerException - Current position does not point to a sequence header.
public void openSequence(int tag)
throws BerException
tag - The expected tag.
BerException - Current position does not point to a sequence header
or the tag is not the expected one.
public void closeSequence()
throws BerException
BerException - The sequence is not expected to finish here.public boolean cannotCloseSequence()
true if the end of the current sequence is not reached.
When this method returns false, closeSequence can (and must) be
invoked.
true if there is still some data in the sequence.
public int getTag()
throws BerException
BerExceptionpublic String toString()
|
FCS Release jdmk-5_1-b34.2 2005.11.29_16:24:00_MET |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||