Class Asn1Buffer2

java.lang.Object
org.apache.directory.api.asn1.util.Asn1Buffer2

public class Asn1Buffer2 extends Object
A buffer used to store an encoding PDU. It's auto-extended, and filled by the end.
Author:
Apache Directory Project
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance of Asn1Buffer2
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the position, emptying the buffer.
    byte[]
    Get the interned bytes
    int
    Get the current position in the buffer
    int
    Get the buffer size
    void
    put(byte b)
    Store a byte at the current position in the buffer
    void
    put(byte[] bytes)
    Store some bytes at the current position in the buffer

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Asn1Buffer2

      public Asn1Buffer2()
      Create a new instance of Asn1Buffer2
  • Method Details

    • getPos

      public int getPos()
      Get the current position in the buffer
      Returns:
      The current position in the buffer
    • 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

      public byte[] getBytes()
      Get the interned bytes
      Returns:
      The stored encoded PDU.
    • getSize

      public int getSize()
      Get the buffer size
      Returns:
      The buffer size (ie the maximum number of bytes that can be added to this buffer 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

      public String toString()
      Overrides:
      toString in class Object