| 限定符和类型 | 方法和说明 |
|---|---|
static int |
bytesToInt(byte[] bytes)
byte数组构成int类型值
与
intToBytes(int)方法互逆,即 value == byteToInt(intToByte(value)) 恒为true |
static long |
bytesToLong(byte[] bytes)
byte数组构成long类型值。
|
static short |
bytesToShort(byte[] bytes)
byte数组构成short类型值
|
static byte[] |
fromHex(String hex)
将表示十六进制值的字符串转换为byte数组
与
toHex(byte[])方法互逆 |
static String |
hexFormat(byte[] bytes)
获取指定字节数组的HEX表示形式(每个字节用空格分隔)
|
static byte[] |
intToBytes(int value)
int型值转换成byte数组
与
bytesToInt(byte[])方法互逆,即 value == byteToInt(intToByte(value)) 恒为true |
static byte[] |
longToBytes(long value)
long型值转换成byte数组。
|
static byte[] |
shortToBytes(short value)
short型转byte数组
|
static String |
toHex(byte value) |
static String |
toHex(byte[] bytes)
以十六进制字符串形式显示byte数组
与
fromHex(String)方法互逆 |
static String |
toHex(int value) |
static String |
toHex(long value) |
static String |
toHex(short value) |
public static int bytesToInt(byte[] bytes)
intToBytes(int)方法互逆,即 value == byteToInt(intToByte(value)) 恒为truebytes - 需要转换成int型值的byte数组public static byte[] intToBytes(int value)
bytesToInt(byte[])方法互逆,即 value == byteToInt(intToByte(value)) 恒为truevalue - 值public static long bytesToLong(byte[] bytes)
longToBytes(long)方法互逆,即 value == bytesToLong(longToBytes(value)) 恒为truebytes - 需要转换成long型值的byte数组public static byte[] longToBytes(long value)
bytesToLong(byte[])方法互逆,即 value == bytesToLong(bytesToLong(value)) 恒为truevalue - public static short bytesToShort(byte[] bytes)
bytes - public static byte[] shortToBytes(short value)
value - public static byte[] fromHex(String hex)
toHex(byte[])方法互逆hex - 需要转换的十六进形式字符串public static String toHex(byte[] bytes)
fromHex(String)方法互逆bytes - 字符数组public static String toHex(int value)
public static String toHex(long value)
public static String toHex(short value)
public static String toHex(byte value)
public static String hexFormat(byte[] bytes)
bytes - 字节数组Copyright © 2020. All rights reserved.