org.ws4d.java.structures
Class ByteArray

java.lang.Object
  extended by org.ws4d.java.structures.ByteArray

public class ByteArray
extends java.lang.Object

Dynamic byte array.


Constructor Summary
ByteArray()
          Dynamic byte array.
 
Method Summary
 void append(byte b)
          Appends a byte to this array.
 byte byteAt(int index)
          Returns the byte at the given position.
 byte[] getBytes()
          Get the byte array from this object.
 int size()
          The size of this byte array.
 java.lang.String toString()
           
 void trunc()
          Truncate the byte array to the correct size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArray

public ByteArray()
Dynamic byte array.

Method Detail

append

public void append(byte b)
Appends a byte to this array.

Parameters:
b - the byte to append.

size

public int size()
The size of this byte array.

Returns:
the size.

byteAt

public byte byteAt(int index)
            throws java.lang.ArrayIndexOutOfBoundsException
Returns the byte at the given position.

Parameters:
index - the position.
Returns:
the byte at the position.
Throws:
java.lang.ArrayIndexOutOfBoundsException

trunc

public void trunc()
Truncate the byte array to the correct size.


getBytes

public byte[] getBytes()
Get the byte array from this object.

Returns:
the byte array.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object