类 ByteUtils
java.lang.Object
cn.zhxu.toys.util.ByteUtils
- 从以下版本开始:
- 0.4.6
- 作者:
- Troy
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Stringbcd(byte[] src, int from, int to) static intcountOf(byte[] arr, byte target) static booleanequals(byte[] arr1, byte[] arr2) static byte[]hexToBytes(String hexContent) static intindexOf(byte[] arr, byte target, int from, int to) 寻找目标字节在字节数组中的下标static byte[]join(byte[]... arrs) static byte[]join(byte hyphen, byte[]... arrs) static byte[][]split(byte[] arr, byte separator) static byte[]subArray(byte[] arr, int from) static byte[]subArray(byte[] arr, int from, int to) static byte[]trim(byte[] src, byte empty) static byte[]trim(byte[] src, byte empty, int from, int to) static intxor(byte[] bytes) 异或值,返回
-
构造器详细资料
-
ByteUtils
public ByteUtils()
-
-
方法详细资料
-
equals
public static boolean equals(byte[] arr1, byte[] arr2) -
split
public static byte[][] split(byte[] arr, byte separator) -
indexOf
public static int indexOf(byte[] arr, byte target, int from, int to) 寻找目标字节在字节数组中的下标- 参数:
arr- 数组target- 目标字节from- 检索开始下标(包含)to- 检索结束下标(不包含)- 返回:
- 找不到则返回-1
-
countOf
public static int countOf(byte[] arr, byte target) -
subArray
public static byte[] subArray(byte[] arr, int from) -
subArray
public static byte[] subArray(byte[] arr, int from, int to) -
join
public static byte[] join(byte hyphen, byte[]... arrs) -
join
public static byte[] join(byte[]... arrs) -
trim
public static byte[] trim(byte[] src, byte empty) -
trim
public static byte[] trim(byte[] src, byte empty, int from, int to) -
bcd
-
xor
public static int xor(byte[] bytes) 异或值,返回- 参数:
bytes- 数组- 返回:
- 异或值
-
hexToBytes
-