org.jboss.mq.il.uil2.msgs
Class DynCircularBuffer

java.lang.Object
  extended byorg.jboss.mq.il.uil2.msgs.DynCircularBuffer

public class DynCircularBuffer
extends java.lang.Object

A circular byte[] buffer capable of expanding its capacity


Constructor Summary
DynCircularBuffer()
          Creates a new instance of DynCircularBuffer
DynCircularBuffer(int capacity)
           
 
Method Summary
 void clear()
           
 void fill(byte[] data)
           
 void fill(byte[] data, int length)
           
 int get()
           
 int get(byte[] b, int off, int length)
           
 int getFreeSpace()
          Get the amount of free space left in the buffer
 int getSize()
          Get the amount of used space in the buffer
static void main(java.lang.String[] args)
          Unit test driver for the buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynCircularBuffer

public DynCircularBuffer()
Creates a new instance of DynCircularBuffer


DynCircularBuffer

public DynCircularBuffer(int capacity)
Method Detail

clear

public void clear()

fill

public void fill(byte[] data)

fill

public void fill(byte[] data,
                 int length)

get

public int get()

get

public int get(byte[] b,
               int off,
               int length)

getSize

public int getSize()
Get the amount of used space in the buffer


getFreeSpace

public int getFreeSpace()
Get the amount of free space left in the buffer


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Unit test driver for the buffer

Throws:
java.lang.Exception