de.jaetzold.util
Class ByteArray

java.lang.Object
  |
  +--de.jaetzold.util.ByteArray

public class ByteArray
extends Object


Constructor Summary
ByteArray(byte[] bytes)
           
 
Method Summary
static byte[] copy(byte[] source)
          Macht eine komplette Kopie des uebergebenen Arrays.
static byte[] copy(byte[] from, int offset, int length)
          Liefert eine Kopie von dem spezifizierten Subarray des uebergebenen Arrays.
 boolean equals(Object o)
           
 int hashCode()
           
static byte[] manageBufferSize(byte[] buffer, int filled, int increase)
          Increase the size of buffer if full, or create it if null.
static byte[] toBytes(short value)
           
static short toShort(byte higher, byte lower)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteArray

public ByteArray(byte[] bytes)
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

copy

public static byte[] copy(byte[] source)
Macht eine komplette Kopie des uebergebenen Arrays.

copy

public static byte[] copy(byte[] from,
                          int offset,
                          int length)
Liefert eine Kopie von dem spezifizierten Subarray des uebergebenen Arrays.
Parameters:
from - das Array welches kopiert werden soll.
offset - der index in from ab dem kopiert werden soll.
length - die Anzahl Elemente die kopiert werden soll.
Throws:
ArrayIndexOutOfBoundsException - if the specified region is not completely in from.

manageBufferSize

public static byte[] manageBufferSize(byte[] buffer,
                                      int filled,
                                      int increase)
Increase the size of buffer if full, or create it if null. After a call to this method one can be sure, that the result
Parameters:
increase - a suggestion for the increase in size.

toShort

public static short toShort(byte higher,
                            byte lower)

toBytes

public static byte[] toBytes(short value)