|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.intarsys.tools.collection.ByteArrayTools
public class ByteArrayTools
| Constructor Summary | |
|---|---|
ByteArrayTools()
|
|
| Method Summary | |
|---|---|
static byte[] |
concat(byte[] array1,
byte[] array2)
|
static byte[] |
copy(byte[] bytes)
Make a copy of bytes. |
static byte[] |
copy(byte[] bytes,
int offset,
int length)
Copy length bytes from bytes starting at
from. |
static byte[] |
createBytes(int length,
byte val)
A byte array with the defined length, filled with val. |
static byte[] |
createRandomBytes(int length)
A random byte sequence of length length. |
static boolean |
equals(byte[] array1,
int offset1,
byte[] array2,
int offset2,
int length)
Checks two arrays or sections thereof for equality. |
static int |
indexOf(byte[] source,
int sourceOffset,
int sourceLen,
byte[] pattern,
int patternOffset,
int patternLen,
int fromIndex)
Search index of pattern in source. |
static boolean |
startsWith(byte[] bytes,
byte[] pattern)
true if bytes starts with the byte sequence
defined in pattern. |
static void |
toBigEndianArray(byte[] bytes,
int offset,
int value,
int size)
|
static byte[] |
toBigEndianArray(int value,
int size)
|
static int |
toBigEndianInteger(byte[] buffer,
int offset,
int size)
|
static void |
toLittleEndianArray(byte[] bytes,
int offset,
int value,
int size)
|
static void |
toLittleEndianArray(byte[] bytes,
int offset,
long value,
int size)
|
static byte[] |
toLittleEndianArray(int value,
int size)
|
static byte[] |
toLittleEndianArray(long value,
int size)
|
static int |
toLittleEndianInteger(byte[] buffer,
int offset,
int size)
|
static long |
toLittleEndianLong(byte[] buffer,
int offset,
int size)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArrayTools()
| Method Detail |
|---|
public static byte[] concat(byte[] array1,
byte[] array2)
public static byte[] copy(byte[] bytes)
bytes.
bytes - byte[] to be copied
bytes
public static byte[] copy(byte[] bytes,
int offset,
int length)
length bytes from bytes starting at
from.
bytes - byte[] to be copiedoffset - starting position to copy fromlength - number of bytes
bytes
public static byte[] createBytes(int length,
byte val)
length - val -
public static byte[] createRandomBytes(int length)
length.
length -
length.
public static boolean equals(byte[] array1,
int offset1,
byte[] array2,
int offset2,
int length)
null or it's section is shorter than the compared length,
false is returned.
array1 - offset1 - array2 - offset2 - length - must have a value greater than 0. A value of 0 always returns
false.
true, if the compared array sections match
public static int indexOf(byte[] source,
int sourceOffset,
int sourceLen,
byte[] pattern,
int patternOffset,
int patternLen,
int fromIndex)
source - sourceOffset - sourceLen - pattern - patternOffset - patternLen - fromIndex -
public static boolean startsWith(byte[] bytes,
byte[] pattern)
true if bytes starts with the byte sequence
defined in pattern.
bytes - pattern -
true if bytes starts with the byte
sequence defined in pattern.
public static void toBigEndianArray(byte[] bytes,
int offset,
int value,
int size)
public static byte[] toBigEndianArray(int value,
int size)
public static int toBigEndianInteger(byte[] buffer,
int offset,
int size)
public static void toLittleEndianArray(byte[] bytes,
int offset,
int value,
int size)
public static void toLittleEndianArray(byte[] bytes,
int offset,
long value,
int size)
public static byte[] toLittleEndianArray(int value,
int size)
public static byte[] toLittleEndianArray(long value,
int size)
public static int toLittleEndianInteger(byte[] buffer,
int offset,
int size)
public static long toLittleEndianLong(byte[] buffer,
int offset,
int size)
|
intarsys runtime library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||