Class Asn1Buffer
java.lang.Object
org.apache.directory.api.asn1.util.Asn1Buffer
A buffer used to store an encoding PDU. It's auto-extended, and
filled by the end.
- Author:
- Apache Directory Project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the position, emptying the buffer.getBytes()Get the interned bytesintgetPos()Get the current position in the bufferintgetSize()Get the buffer sizevoidput(byte b) Store a byte at the current position in the buffervoidput(byte[] bytes) Store some bytes at the current position in the buffervoidsetPos(int pos) Set the current position in the buffertoString()
-
Constructor Details
-
Asn1Buffer
public Asn1Buffer()Creates a new Asn1Buffer instance
-
-
Method Details
-
getPos
public int getPos()Get the current position in the buffer- Returns:
- The current position in the buffer
-
setPos
public void setPos(int pos) Set the current position in the buffer- Parameters:
pos- The position to move the buffer to
-
put
public void put(byte b) Store a byte at the current position in the buffer- Parameters:
b- The byte to store
-
put
public void put(byte[] bytes) Store some bytes at the current position in the buffer- Parameters:
bytes- The bytes to store
-
getBytes
-
getSize
public int getSize()Get the buffer size- Returns:
- The buffer size (ie the maximum number of bytes that can be added to this bffder before it gets extended).
-
clear
public void clear()Clear the position, emptying the buffer. If it has grown, reallocate it to its initial size. -
toString
-