public class ArrayKits extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ArrayKits.HashEnty |
| 构造器和说明 |
|---|
ArrayKits() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
addAll(byte[]... arrays) |
static int |
bytesToInt(byte[] src,
int offset) |
static long |
bytesToLong(byte[] bytes) |
static byte[] |
intToBytes(int value) |
static int |
length(Object array)
获取数组长度
如果参数为 null,返回0
ArrayUtil.length(null) = 0
ArrayUtil.length([]) = 0
ArrayUtil.length([null]) = 1
ArrayUtil.length([true, false]) = 2
ArrayUtil.length([1, 2, 3]) = 3
ArrayUtil.length(["a", "b", "c"]) = 3
|
static byte[] |
longToBytes(long x) |
static byte[] |
newArray(Class<?> componentType,
int newSize) |
static boolean |
noRepeate(byte[][] bytess) |
static boolean |
noRepeate2(List<ArrayKits.HashEnty> bytess) |
static boolean |
noRepeateFinal(List<byte[]> bytess) |
static byte[] |
sub(byte[] array,
int start,
int end)
获取子数组
|
public static byte[] newArray(Class<?> componentType, int newSize)
public static byte[] addAll(byte[]... arrays)
public static byte[] longToBytes(long x)
public static long bytesToLong(byte[] bytes)
public static byte[] intToBytes(int value)
public static int bytesToInt(byte[] src,
int offset)
public static byte[] sub(byte[] array,
int start,
int end)
array - 数组start - 开始位置(包括)end - 结束位置(不包括)Arrays.copyOfRange(Object[], int, int)public static int length(Object array) throws IllegalArgumentException
null,返回0
ArrayUtil.length(null) = 0 ArrayUtil.length([]) = 0 ArrayUtil.length([null]) = 1 ArrayUtil.length([true, false]) = 2 ArrayUtil.length([1, 2, 3]) = 3 ArrayUtil.length(["a", "b", "c"]) = 3
array - 数组对象IllegalArgumentException - 如果参数不为数组,抛出此异常Array.getLength(Object)public static boolean noRepeateFinal(List<byte[]> bytess)
public static boolean noRepeate(byte[][] bytess)
public static boolean noRepeate2(List<ArrayKits.HashEnty> bytess)
Copyright © 2020. All rights reserved.