public final class ByteUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
concat(byte[] arg1,
byte[] arg2) |
static byte[] |
concatAll(byte[]... args) |
static int |
indexOf(byte[] haystack,
byte needle)
Searches the specified array of bytes for the specified value.
|
static byte[][] |
mergeArrays(byte[] firstArray,
byte[]... additionalArrays)
Merge multiple
byte arrays into one array |
static byte[][] |
split(byte[] source,
int c) |
static boolean |
startsWith(byte[] haystack,
byte[] prefix)
Tests if the
haystack starts with the given prefix. |
static boolean |
startsWith(byte[] haystack,
byte[] prefix,
int offset)
Tests if the
haystack beginning at the specified offset starts with the given prefix. |
public static byte[] concat(byte[] arg1,
byte[] arg2)
public static byte[] concatAll(byte[]... args)
public static byte[][] split(byte[] source,
int c)
public static byte[][] mergeArrays(byte[] firstArray,
byte[]... additionalArrays)
byte arrays into one arrayfirstArray - must not be nulladditionalArrays - must not be nullpublic static boolean startsWith(byte[] haystack,
byte[] prefix)
haystack starts with the given prefix.haystack - the source to scan.prefix - the prefix to find.haystack at position offset starts with prefix.startsWith(byte[], byte[], int)public static boolean startsWith(byte[] haystack,
byte[] prefix,
int offset)
haystack beginning at the specified offset starts with the given prefix.haystack - the source to scan.prefix - the prefix to find.offset - the offset to start at.haystack at position offset starts with prefix.public static int indexOf(byte[] haystack,
byte needle)
haystacks natural order or -1 of needle could not be found.haystack - the source to scan.needle - the value to scan for.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.