public abstract class AbstractAsn1Object extends Object implements Asn1Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractAsn1Object()
Default constructor.
|
protected |
AbstractAsn1Object(int tlvId)
Constructor associated with a TLV identifier.
|
Modifier and Type | Method and Description |
---|---|
void |
addLength(int length)
Add a length to the object
|
abstract int |
computeLength()
Compute the object length, which is the sum of all inner length.
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the object to a PDU.
|
int |
getCurrentLength()
Get the current object length, which is the sum of all inner length
already decoded.
|
int |
getExpectedLength()
Get the expected object length.
|
AbstractAsn1Object |
getParent()
Get the parent
|
int |
getTlvId() |
void |
setCurrentLength(int currentLength)
Set the current length
|
void |
setExpectedLength(int expectedLength)
Set the expected length
|
void |
setParent(AbstractAsn1Object parent)
Set the parent
|
protected AbstractAsn1Object(int tlvId)
tlvId
- The TLV Id.protected AbstractAsn1Object()
public int getCurrentLength()
getCurrentLength
in interface Asn1Object
public abstract int computeLength()
computeLength
in interface Asn1Object
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
encode
in interface Asn1Object
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic int getExpectedLength()
getExpectedLength
in interface Asn1Object
public void addLength(int length) throws DecoderException
addLength
in interface Asn1Object
length
- The length to add.DecoderException
- Thrown if the current length exceed the expected lengthpublic void setExpectedLength(int expectedLength)
setExpectedLength
in interface Asn1Object
expectedLength
- The expectedLength to set.public void setCurrentLength(int currentLength)
setCurrentLength
in interface Asn1Object
currentLength
- The currentLength to set.public AbstractAsn1Object getParent()
getParent
in interface Asn1Object
public void setParent(AbstractAsn1Object parent)
parent
- The parent to set.public int getTlvId()
Copyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.