org.apache.directory.shared.ldap.util
Class ByteBuffer

java.lang.Object
  extended by org.apache.directory.shared.ldap.util.ByteBuffer

public class ByteBuffer
extends java.lang.Object

A dynamically growing byte[].

Version:
$Rev$
Author:
Apache Directory Project

Constructor Summary
ByteBuffer()
           
ByteBuffer(int initialSize)
           
 
Method Summary
 void append(byte bite)
          Appends a byte to this buffer.
 void append(int val)
          Appends an int to this buffer.
 byte[] buffer()
          Get's the bytes, the backing store for this buffer.
 int capacity()
           
 void clear()
           
 byte[] copyOfUsedBytes()
          Get's a copy of the bytes used.
 byte get(int ii)
           
 int position()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBuffer

public ByteBuffer()

ByteBuffer

public ByteBuffer(int initialSize)
Method Detail

clear

public final void clear()

position

public final int position()

capacity

public final int capacity()

get

public final byte get(int ii)

buffer

public final byte[] buffer()
Get's the bytes, the backing store for this buffer. Note that you need to use the position index to determine where to stop reading from this buffer.


copyOfUsedBytes

public final byte[] copyOfUsedBytes()
Get's a copy of the bytes used.


append

public final void append(byte bite)
Appends a byte to this buffer.


append

public final void append(int val)
Appends an int to this buffer. WARNING: the int is truncated to a byte value.



Copyright © 2004-2011. All Rights Reserved.