public class ArrayUtils extends Object
Operations on arrays, primitive arrays (like int[]) and
primitive wrapper arrays (like Integer[]).
This class tries to handle null input gracefully. An exception
will not be thrown for a null array input. However, an Object
array that contains a null element may throw an exception. Each
method documents its behaviour.
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
EMPTY_BYTE_ARRAY
An empty immutable
byte array. |
| 构造器和说明 |
|---|
ArrayUtils() |
public static byte[] subarray(byte[] array,
int startIndexInclusive,
int endIndexExclusive)
Produces a new byte array containing the elements between
the start and end indices.
The start index is inclusive, the end index exclusive. Null array input produces null output.
array - the arraystartIndexInclusive - the starting index. Undervalue (<0) is promoted to 0,
overvalue (>array.length) results in an empty array.endIndexExclusive - elements up to endIndex-1 are present in the returned
subarray. Undervalue (< startIndex) produces empty array,
overvalue (>array.length) is demoted to array length.Copyright © 2022 Baidu, Inc.. All rights reserved.