类 ByteUtils
- java.lang.Object
-
- com.baidubce.services.iothisk.device.utils.ByteUtils
-
public class ByteUtils extends Object
Provides byte array operation utilities
-
-
构造器概要
构造器 构造器 说明 ByteUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static byte[]getCounterBytes(long counter)Get byte array from counter valuestatic byte[]toBytesFromHex(String data)Get byte array from hex stringstatic byte[]toBytesFromInt(int number)Get byte array from int type valuestatic StringtoHexStringFromBytes(byte[] data)Get hex string from byte arraystatic longtoLongFromBytes(byte[] data)Get long value from byte array
-
-
-
方法详细资料
-
toBytesFromHex
public static byte[] toBytesFromHex(String data)
Get byte array from hex string- 参数:
data- specified hex string data- 返回:
- byte array
-
toHexStringFromBytes
public static String toHexStringFromBytes(byte[] data)
Get hex string from byte array- 参数:
data- specified byte array- 返回:
- hex string
-
toBytesFromInt
public static byte[] toBytesFromInt(int number)
Get byte array from int type value- 参数:
number- specified in type value- 返回:
- byte array
-
toLongFromBytes
public static long toLongFromBytes(byte[] data)
Get long value from byte array- 参数:
data- specified byte array- 返回:
- successful long type value, otherwise an exception will be thrown
-
getCounterBytes
public static byte[] getCounterBytes(long counter)
Get byte array from counter value- 参数:
counter- specified counter value- 返回:
- successful byte value array, otherwise an exception will be thrown
-
-