public class ArrayUtils extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static byte[] |
CASE_INSENSITIVE
Case insensitive array where [i] == toLowerCase(i).
|
protected static byte[] |
CASE_SENSITIVE
Case sensitive array where [i] == i.
|
static byte[] |
SKIP_NONWHITESPACE
Array where the character equal to the index is 1 only for non whitespace characters.
|
static byte[] |
SKIP_WHITESPACE
Array where the character equal to the index is 1 only for whitespace characters.
|
protected static byte[] |
zeroArr
Zero length byte array.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ArrayUtils()
Purely for unit testing.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equalsAt(byte[] subArr,
byte[] arr,
int fIdx)
Check if a byte array matches a specified case sensitive sub byte array at a certain index.
|
static boolean |
equalsAtIgnoreCase(byte[] subArr,
byte[] arr,
int fIdx)
Check if a byte array matches a specified case insensitive sub byte array at a certain index.
|
static int |
indexOf(byte[] subArr,
byte[] arr,
int fIdx)
Find the next case sensitive occurrence of a byte sub array in a larger byte array beginning from a specific index.
|
static int |
indexOfIgnoreCase(byte[] subArr,
byte[] arr,
int fIdx)
Find the next case insensitive occurrence of a byte sub array in a larger byte array beginning from a specific index.
|
static int |
skip(byte[] skip,
byte[] arr,
int fIdx)
Move index forward according to the values in the byte array and the skip byte array which decides which byte values must be skipped.
|
static java.util.List<byte[]> |
split(byte[] arr,
byte[] subArr,
int fIdx,
int tIdx)
Case sensitive split a byte array into a list of byte arrays.
|
static boolean |
startsWith(byte[] subArr,
byte[] arr)
Check if a byte array starts with a specified case sensitive sub byte array.
|
static boolean |
startsWithIgnoreCase(byte[] subArr,
byte[] arr)
Check if a byte array starts with a specified case insensitive sub byte array.
|
protected static final byte[] CASE_SENSITIVE
protected static final byte[] CASE_INSENSITIVE
public static final byte[] SKIP_WHITESPACE
public static final byte[] SKIP_NONWHITESPACE
protected static final byte[] zeroArr
protected ArrayUtils()
public static int skip(byte[] skip, byte[] arr, int fIdx)
skip - byte array deciding which byte values must be skippedarr - byte array to skip infIdx - byte array indexpublic static boolean startsWith(byte[] subArr, byte[] arr)
subArr - case sensitive sub byte array to compare forarr - byte array to look inpublic static boolean startsWithIgnoreCase(byte[] subArr, byte[] arr)
subArr - case insensitive sub byte array to compare forarr - byte array to look inpublic static boolean equalsAt(byte[] subArr, byte[] arr, int fIdx)
subArr - case sensitive sub byte array to compare againstarr - byte array to look infIdx - index to start looking from in arrpublic static boolean equalsAtIgnoreCase(byte[] subArr, byte[] arr, int fIdx)
subArr - case sensitive sub byte array to compare againstarr - byte array to look infIdx - index to start looking from in arrpublic static int indexOf(byte[] subArr, byte[] arr, int fIdx)
subArr - case sensitive byte sub array to compare againstarr - byte array to look infIdx - index to starting looking frompublic static int indexOfIgnoreCase(byte[] subArr, byte[] arr, int fIdx)
subArr - case insensitive byte sub array to compare againstarr - byte array to look infIdx - index to starting looking frompublic static java.util.List<byte[]> split(byte[] arr, byte[] subArr, int fIdx, int tIdx)
arr - byte array to splitsubArr - case sensitive byte sub array to split aroundfIdx - from index to start from when splittingtIdx - to index to end splittingCopyright © 2011–2023. All rights reserved.