public class ByteArrayTools
extends java.lang.Object
| Constructor and Description |
|---|
ByteArrayTools() |
| Modifier and Type | Method and Description |
|---|---|
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 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. |
public static byte[] concat(byte[] array1,
byte[] array2)
public static byte[] copy(byte[] bytes)
bytes.bytes - byte[] to be copiedbytespublic 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 bytesbytespublic 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.