Class Asn1Decoder
- java.lang.Object
-
- org.apache.directory.api.asn1.ber.Asn1Decoder
-
- All Implemented Interfaces:
TLVBerDecoderMBean
public final class Asn1Decoder extends Object implements TLVBerDecoderMBean
A BER TLV Tag component decoder. This decoder instantiate a Tag. The tag won't be implementations should not copy the handle to the Tag object delivered but should copy the data if they need it over the long term.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
decode(ByteBuffer stream, Asn1Container container)
The decoder main function.int
getMaxLengthLength()
Get the actual maximum number of bytes that can be used to encode the Lengthint
getMaxTagLength()
Get the actual maximum number of bytes that can be used to encode the Tagboolean
isIndefiniteLengthAllowed()
Tell if indefinite length form could be used for Length
-
-
-
Method Detail
-
decode
public static void decode(ByteBuffer stream, Asn1Container container) throws DecoderException
The decoder main function. This is where we read bytes from the stream and go through the automaton. It's an inifnite loop which stop when no more bytes are to be read. It can occurs if the ByteBuffer is exhausted or if the PDU has been fully decoded.- Parameters:
stream
- The ByteBuffer containing the PDU to decodecontainer
- The container that store the state, the result and other elements.- Throws:
DecoderException
- Thrown if anything went wrong!
-
getMaxLengthLength
public int getMaxLengthLength()
Get the actual maximum number of bytes that can be used to encode the Length- Specified by:
getMaxLengthLength
in interfaceTLVBerDecoderMBean
- Returns:
- The maximum bytes of the Length
-
getMaxTagLength
public int getMaxTagLength()
Get the actual maximum number of bytes that can be used to encode the Tag- Specified by:
getMaxTagLength
in interfaceTLVBerDecoderMBean
- Returns:
- The maximum length of the Tag
-
isIndefiniteLengthAllowed
public boolean isIndefiniteLengthAllowed()
Tell if indefinite length form could be used for Length- Specified by:
isIndefiniteLengthAllowed
in interfaceTLVBerDecoderMBean
- Returns:
true
if the Indefinite form is allowed
-
-