Class ByteBuf

java.lang.Object
netscape.ldap.util.ByteBuf
All Implemented Interfaces:
Serializable

public final class ByteBuf extends Object implements Serializable
This class is similar to the java.lang.StringBuffer class. Instead of storing a string, an object of this class stores an array of bytes. (This is referred to as a "byte buffer".)

This class also differs from StringBuffer in the following ways:

  • None of the methods are synchronized. You cannot share a byte buffer among multiple threads.
  • Converting to a String requires a copy of the character data.
  • In order to speed up memory allocation, Alloc and Recycle methods are provided. You can "recycle" any ByteBuf objects you no longer need by using the Recycle method. Calling the Alloc method will reuse objects that have been "recycled." To To clear out the cache of these "recycled" objects, use the EmptyRecycler method.
  • Additional "helper" methods are provided (for example, functions for comparing data).
See Also: