LDAP Classes
Implements Java LDAP

com.novell.ldap.asn1
Interface ASN1Encoder

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

public interface ASN1Encoder
extends java.io.Serializable

This interface defines the methods for encoding each of the ASN.1 types. Encoders which implement this interface may be used to encode any of the ASN1Object data types.

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

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

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


Method Summary
 void encode(ASN1Boolean b, java.io.OutputStream out)
          Encode an ASN1Boolean directly into the provided output stream.
 void encode(ASN1Identifier id, java.io.OutputStream out)
          Encode an ASN1Identifier directly to a stream.
 void encode(ASN1Null n, java.io.OutputStream out)
          Encode an ASN1Null directly to a stream.
 void encode(ASN1Numeric n, java.io.OutputStream out)
          Encode an ASN1Numeric directly to a stream.
 void encode(ASN1OctetString os, java.io.OutputStream out)
          Encode an ASN1OctetString directly to a stream.
 void encode(ASN1Structured c, java.io.OutputStream out)
          Encode an ASN1Structured directly to a stream.
 void encode(ASN1Tagged t, java.io.OutputStream out)
          Encode an ASN1Tagged directly to a stream.
 

Method Detail

encode

public void encode(ASN1Boolean b,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Boolean directly into the provided output stream.

Parameters:
b - The ASN1Boolean object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1Numeric n,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Numeric directly to a stream.

Use a two's complement representation in the fewest number of octets possible. Can be used to encode both INTEGER and ENUMERATED values.

Parameters:
n - The ASN1Numeric object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1Null n,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Null directly to a stream.

Parameters:
n - The ASN1Null object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1OctetString os,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1OctetString directly to a stream.

Parameters:
os - The ASN1OctetString object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1Structured c,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Structured directly to a stream.

Parameters:
c - The ASN1Structured object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1Tagged t,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Tagged directly to a stream.

Parameters:
t - The ASN1Tagged object to encode
out - The output stream onto which the ASN.1 object is to be encoded
Throws:
java.io.IOException

encode

public void encode(ASN1Identifier id,
                   java.io.OutputStream out)
            throws java.io.IOException
Encode an ASN1Identifier directly to a stream.

Parameters:
id - The ASN1Identifier object to encode
out - The output stream onto which the ASN.1 object is to be encoded
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