类 HexUtils
java.lang.Object
com.cdkjframework.util.tool.HexUtils
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static String
bytesToHexString
(byte[] src, int start, int end) 将字节转换为字符串static String
byteToHexString
(byte data) 字节转十六进制static String
byteToHexString
(byte[] data) 字节转十六进制static String
charArrayToHex
(char[] chars) char数组转hex字符串static String
charArrayToHex
(char[] chars, boolean toLowerCase) char数组转hex字符串static byte[]
decodeHex
(char[] data) static char[]
encodeHex
(byte[] data) static char[]
encodeHex
(byte[] data, boolean toLowerCase) static String
encodeHexStr
(byte[] data) static String
encodeHexStr
(byte[] data, boolean toLowerCase) static String
encodeHexStr
(long data, boolean toLowerCase) static String
hexStringToString
(String str) 16进制转换成为string类型字符串static byte
Hex字符串转bytestatic byte[]
hexToByteArray
(String inHex) hex字符串转byte数组static String
intToHex
(int n, boolean toUpperCase) 10进制转换为16进制static String
longToHex
(long n, boolean toUpperCase) long转16进制static String
字符串转化成为16进制字符串static int
16进制转10进制static Long
16进制转 long
-
构造器详细资料
-
HexUtils
public HexUtils()
-
-
方法详细资料
-
encodeHex
public static char[] encodeHex(byte[] data) - 参数:
data
- byte[]- 返回:
- 十六进制char[]
-
encodeHex
public static char[] encodeHex(byte[] data, boolean toLowerCase) - 参数:
data
- byte[]toLowerCase
- true传换成小写格式 ,false传换成大写格式- 返回:
- 十六进制char[]
-
encodeHexStr
- 参数:
data
- byte[]- 返回:
- 十六进制String
-
encodeHexStr
- 参数:
data
- byte[]toLowerCase
- true 传换成小写格式 , false 传换成大写格式- 返回:
- 十六进制String
-
encodeHexStr
- 参数:
data
- byte[]toLowerCase
- true 传换成小写格式 , false 传换成大写格式- 返回:
- 十六进制String
-
decodeHex
public static byte[] decodeHex(char[] data) - 参数:
data
- 十六进制char[]- 返回:
- byte[]
- 抛出:
RuntimeException
- 如果源十六进制字符数组是一个奇怪的长度,将抛出运行时异常
-
hexToByteArray
hex字符串转byte数组- 参数:
inHex
- 待转换的Hex字符串- 返回:
- 转换后的byte数组结果
-
charArrayToHex
char数组转hex字符串- 参数:
chars
- char数组- 返回:
- 转换后的hex字符串
-
charArrayToHex
char数组转hex字符串- 参数:
chars
- char数组toLowerCase
- 是否大写- 返回:
- 转换后的hex字符串
-
hexToByte
Hex字符串转byte- 参数:
inHex
- 待转换的Hex字符串- 返回:
- 转换后的byte
-
toDigit
16进制转10进制- 参数:
hex
- 16进制字符- 返回:
- 返回结果
-
toLong
16进制转 long- 参数:
hex
- 16进制字符- 返回:
- 返回结果
-
byteToHexString
字节转十六进制- 参数:
data
- byte数组- 返回:
- String 转换后的字符串 将byte[]数组转换为String字符串
-
byteToHexString
字节转十六进制- 参数:
data
- byte数组- 返回:
- String 转换后的字符串 将byte[]数组转换为String字符串
-
bytesToHexString
将字节转换为字符串- 参数:
src
- 字节start
- 开始end
- 结束- 返回:
- 返回字符
-
hexStringToString
16进制转换成为string类型字符串- 参数:
str
-- 返回:
-
strToHex
字符串转化成为16进制字符串- 参数:
str
- 字符串- 返回:
- 返回结果
-
intToHex
10进制转换为16进制- 参数:
n
- 整数toUpperCase
- 是否大写
-
longToHex
long转16进制- 参数:
n
- 数据toUpperCase
- 是否大写- 返回:
-