org.apache.asn1.ber
Class BEREncoder
java.lang.Object
org.apache.asn1.codec.stateful.AbstractStatefulEncoder
org.apache.asn1.ber.BEREncoder
- All Implemented Interfaces:
- org.apache.asn1.codec.stateful.StatefulEncoder, TupleEventConsumer
- public class BEREncoder
- extends org.apache.asn1.codec.stateful.AbstractStatefulEncoder
- implements TupleEventConsumer
A BER TLV tuple encoder. This encoder receives events via a
BEREncoderCallback. Hence the callback is used to deliver events to this
encoder or event consumer. The product is announced via an regular encoder
event.
- Author:
- Apache Directory
Project $Rev: 157644 $
Fields inherited from class org.apache.asn1.codec.stateful.AbstractStatefulEncoder |
|
Constructor Summary |
BEREncoder()
Creates a BEREncoder with the default buffer size. |
BEREncoder(int bufSz)
Creates a BEREncoder with a specific buffer size. |
Methods inherited from class org.apache.asn1.codec.stateful.AbstractStatefulEncoder |
encodeOccurred, getEncoderMonitor, setCallback, setEncoderMonitor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BUFSZ
private static final int DEFAULT_BUFSZ
- See Also:
- Constant Field Values
buf
private java.nio.ByteBuffer buf
BEREncoder
public BEREncoder()
- Creates a BEREncoder with the default buffer size.
BEREncoder
public BEREncoder(int bufSz)
- Creates a BEREncoder with a specific buffer size.
- Parameters:
bufSz
- the size of the buffer
encode
public void encode(java.lang.Object obj)
- Overriden encode method which does nothing but throw an exception. This
has been done to prevent interference with the stream of TLV events
processed by this encoder. A special BEREncoderCallback implementation
is used by this class to recieve events. This callback is not the same
as the callback used to inform of encode events which emits ByteBuffer
objects.
- Specified by:
encode
in interface org.apache.asn1.codec.stateful.StatefulEncoder
- Parameters:
obj
- the object to encode
- Throws:
java.lang.UnsupportedOperationException
- every time
tag
public void tag(Tuple tlv)
- Specified by:
tag
in interface TupleEventConsumer
length
public void length(Tuple tlv)
- Specified by:
length
in interface TupleEventConsumer
chunkedValue
public void chunkedValue(Tuple tlv,
java.nio.ByteBuffer chunk)
- Specified by:
chunkedValue
in interface TupleEventConsumer
finish
public void finish(Tuple tlv)
- Specified by:
finish
in interface TupleEventConsumer
Copyright © 2004-2006 . All Rights Reserved.