de.jaetzold.util
Class ByteArray
java.lang.Object
|
+--de.jaetzold.util.ByteArray
- public class ByteArray
- extends Object
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()
|
ByteArray
public ByteArray(byte[] bytes)
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
- is non-null
- contains everything what buffer contains, at the same position
- has a length greater than filled
- is == buffer, if and only if buffer meets the above requirements.
- 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)