LDAP Classes
Implements Java LDAP

com.novell.ldap.asn1
Interface ASN1Decoder

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
LBERDecoder

public interface ASN1Decoder
extends java.io.Serializable

This interface defines the methods for decoding each of the ASN.1 types. Decoders which implement this interface may be used to decode any of the ASN1Object data types.

This package also provides the BERDecoder class that can be used to BER decode ASN.1 classes. However an application might chose to use its own decoder class.

This interface thus allows an application to use this package to decode ASN.1 objects using other decoding rules if needed.

Note that LDAP packets are required to be BER encoded. Since this package includes a BER decoder no application provided decoder is needed for building LDAP packets.


Method Summary
 ASN1Object decode(byte[] value)
          Decode an encoded value into an ASN1Object from a byte array.
 ASN1Object decode(java.io.InputStream in)
          Decode an encoded value into an ASN1Object from an InputStream.
 ASN1Object decode(java.io.InputStream in, int[] length)
          Decode an encoded value into an ASN1Object from an InputStream.
 java.lang.Object decodeBoolean(java.io.InputStream in, int len)
          Decode a BOOLEAN directly from a stream.
 java.lang.Object decodeCharacterString(java.io.InputStream in, int len)
          Decode a CharacterString directly from a stream.
 java.lang.Object decodeNumeric(java.io.InputStream in, int len)
          Decode a Numeric value directly from a stream.
 java.lang.Object decodeOctetString(java.io.InputStream in, int len)
          Decode an OCTET_STRING directly from a stream.
 

Method Detail

decode

public ASN1Object decode(byte[] value)
Decode an encoded value into an ASN1Object from a byte array.

Parameters:
value - A byte array that points to the encoded ASN1 data

decode

public ASN1Object decode(java.io.InputStream in)
                  throws java.io.IOException
Decode an encoded value into an ASN1Object from an InputStream.

Parameters:
in - An input stream containig the encoded ASN.1 data.
Throws:
java.io.IOException

decode

public ASN1Object decode(java.io.InputStream in,
                         int[] length)
                  throws java.io.IOException
Decode an encoded value into an ASN1Object from an InputStream.

Parameters:
length - The decoded components encoded length. This value is handy when decoding structured types. It allows you to accumulate the number of bytes decoded, so you know when the structured type has decoded all of its components.
in - An input stream containig the encoded ASN.1 data.
Throws:
java.io.IOException

decodeBoolean

public java.lang.Object decodeBoolean(java.io.InputStream in,
                                      int len)
                               throws java.io.IOException
Decode a BOOLEAN directly from a stream. Call this method when you know that the next ASN.1 encoded element is a BOOLEAN

Parameters:
in - An input stream containig the encoded ASN.1 data.
len - Length in bytes
Throws:
java.io.IOException

decodeNumeric

public java.lang.Object decodeNumeric(java.io.InputStream in,
                                      int len)
                               throws java.io.IOException
Decode a Numeric value directly from a stream. Call this method when you know that the next ASN.1 encoded element is a Numeric

Can be used to decodes INTEGER and ENUMERATED types.

Parameters:
in - An input stream containig the encoded ASN.1 data.
len - Length in bytes
Throws:
java.io.IOException

decodeOctetString

public java.lang.Object decodeOctetString(java.io.InputStream in,
                                          int len)
                                   throws java.io.IOException
Decode an OCTET_STRING directly from a stream. Call this method when you know that the next ASN.1 encoded element is a OCTET_STRING.

Parameters:
in - An input stream containig the encoded ASN.1 data.
len - Length in bytes
Throws:
java.io.IOException

decodeCharacterString

public java.lang.Object decodeCharacterString(java.io.InputStream in,
                                              int len)
                                       throws java.io.IOException
Decode a CharacterString directly from a stream. Decodes any of the specialized character strings.

Parameters:
in - An input stream containig the encoded ASN.1 data.
len - Length in bytes
Throws:
java.io.IOException

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000