gnu.inet.ldap

Class BERDecoder


public class BERDecoder
extends java.lang.Object

Utility class for decoding BER values. For each value to be read, the application must call parseType to return the type of the value, then the specific parseXXX method for the type to return the actual value, or skip to skip the value.

Constructor Summary

BERDecoder(byte[] data, boolean utf8)

Method Summary

boolean
available()
static void
main(String[] args)
boolean
parseBoolean()
int
parseInt()
byte[]
parseOctetString()
BERDecoder
parseSequence()
BERDecoder
parseSequence(int code)
BERDecoder
parseSet()
BERDecoder
parseSet(int code)
String
parseString()
int
parseType()
Returns the type of the current value record.
void
skip()

Constructor Details

BERDecoder

public BERDecoder(byte[] data,
                  boolean utf8)

Method Details

available

public boolean available()

main

public static void main(String[] args)

parseBoolean

public boolean parseBoolean()
            throws BERException

parseInt

public int parseInt()
            throws BERException

parseOctetString

public byte[] parseOctetString()
            throws BERException

parseSequence

public BERDecoder parseSequence()
            throws BERException

parseSequence

public BERDecoder parseSequence(int code)
            throws BERException

parseSet

public BERDecoder parseSet()
            throws BERException

parseSet

public BERDecoder parseSet(int code)
            throws BERException

parseString

public String parseString()
            throws BERException

parseType

public int parseType()
            throws BERException
Returns the type of the current value record. If there are no more records to read, this method returns -1.

skip

public void skip()