public class ByteUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(byte[] source,
byte[] match)
Does the source array equal the match array?
|
static void |
getBytes(byte[] source,
int srcBegin,
int srcEnd,
byte[] destination,
int dstBegin)
Copies bytes from the source byte array to the destination array
|
static int |
indexOf(byte[] source,
byte[] match)
Returns the index in the source array where the first occurrence
of the specified byte pattern is found
|
static int |
indexOf(byte[] source,
String matchString)
Returns the index in the source array where the first occurrence
of the specified text (a String, converted to a byte array) is found
|
static int |
lastIndexOf(byte[] source,
byte[] match)
Returns the index in the source array where the last occurrence
of the specified byte pattern is found
|
static int |
lastIndexOf(byte[] source,
String matchString)
Returns the index in the source array where the last occurrence
of the specified text (a String, converted to a byte array) is found
|
static void |
main(String[] args) |
static boolean |
startsWith(byte[] source,
byte[] match)
Does this byte array begin with match array content?
|
static boolean |
startsWith(byte[] source,
int offset,
byte[] match)
Does this byte array begin with match array content?
|
static byte[] |
subbytes(byte[] source,
int srcBegin)
Return a new byte array containing a sub-portion of the source array
|
static byte[] |
subbytes(byte[] source,
int srcBegin,
int srcEnd)
Return a new byte array containing a sub-portion of the source array
|
public static int indexOf(byte[] source,
String matchString)
source - Byte array to examinematchString - String to locate in sourcepublic static int indexOf(byte[] source,
byte[] match)
source - Byte array to examinematch - Byte array to locate in sourcepublic static int lastIndexOf(byte[] source,
String matchString)
source - Byte array to examinematchString - String to locate in sourcepublic static int lastIndexOf(byte[] source,
byte[] match)
source - Byte array to examinematch - Byte array to locate in sourcepublic static boolean startsWith(byte[] source,
byte[] match)
source - Byte array to examinematch - Byte array to locate in sourcepublic static boolean startsWith(byte[] source,
int offset,
byte[] match)
source - Byte array to examineoffset - An offset into the source arraymatch - Byte array to locate in sourcepublic static boolean equals(byte[] source,
byte[] match)
source - Byte array to examineoffset - An offset into the source arraymatch - Byte array to locate in sourcepublic static void getBytes(byte[] source,
int srcBegin,
int srcEnd,
byte[] destination,
int dstBegin)
source - The source arraysrcBegin - Index of the first source byte to copysrcEnd - Index after the last source byte to copydestination - The destination arraydstBegin - The starting offset in the destination arraypublic static byte[] subbytes(byte[] source,
int srcBegin,
int srcEnd)
srcBegin - The beginning index (inclusive)srcEnd - The ending index (exclusive)public static byte[] subbytes(byte[] source,
int srcBegin)
srcBegin - The beginning index (inclusive)Copyright © 2003–2020 Sakai Project. All rights reserved.