Class Asn1Decoder
java.lang.Object
org.apache.directory.api.asn1.ber.Asn1Decoder
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptionstatic voiddecode(ByteBuffer stream, Asn1Container container) The decoder main function.intGet the actual maximum number of bytes that can be used to encode the LengthintGet the actual maximum number of bytes that can be used to encode the TagbooleanTell if indefinite length form could be used for Length
-
Method Details
-
decode
public static void decode(ByteBuffer stream, Asn1Container container) throws org.apache.directory.api.asn1.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:
org.apache.directory.api.asn1.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:
getMaxLengthLengthin 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:
getMaxTagLengthin interfaceTLVBerDecoderMBean- Returns:
- The maximum length of the Tag
-
isIndefiniteLengthAllowed
public boolean isIndefiniteLengthAllowed()Tell if indefinite length form could be used for Length- Specified by:
isIndefiniteLengthAllowedin interfaceTLVBerDecoderMBean- Returns:
trueif the Indefinite form is allowed
-