类 HexUtil
java.lang.Object
com.xiaoTools.util.hexUtil.HexUtil
public class HexUtil extends Object
[16进制工具](Hex tool)
- 从以下版本开始:
- 2021/5/15 12:10 下午
- 作者:
- XiaoXunYao
-
构造器概要
构造器 构造器 说明 HexUtil()
[初始化项目](Initialize project) -
方法概要
修饰符和类型 方法 说明 static void
appendHex(StringBuilder builder, byte b, boolean toLowerCase)
[将byte值转为16进制并添加到StringBuilder中](Convert the byte value to hexadecimal and add it to StringBuilder)static Color
decodeColor(String hexColor)
[将Hex颜色值转为Color](Convert hex color value to color)static byte[]
decodeHex(char[] hexData)
[将十六进制字符数组转换为字节数组](Converts a hexadecimal character array to a byte array)static byte[]
decodeHex(String hexStr)
[将十六进制字符串解码为byte[]](Decode hexadecimal string to byte [])static String
decodeHexStr(char[] hexData, Charset charset)
[将十六进制字符数组转换为字符串](Converts a hexadecimal character array to a string)static String
decodeHexStr(String hexStr)
[将十六进制字符数组转换为字符串,默认编码UTF-8](Convert hexadecimal character array to string, default encoding UTF-8)static String
decodeHexStr(String hexStr, Charset charset)
[将十六进制字符数组转换为字符串](Converts a hexadecimal character array to a string)static String
encodeColor(Color color)
[将Color编码为Hex形式](Encode color to hex form)static String
encodeColor(Color color, String prefix)
[将Color编码为Hex形式](Encode color to hex form)static char[]
encodeHex(byte[] data)
[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)static char[]
encodeHex(byte[] data, boolean toLowerCase)
[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)static char[]
encodeHex(String str, Charset charset)
[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)static String
encodeHexStr(byte[] data)
[将字节数组转换为十六进制字符串](Converts a byte array to a hexadecimal string)static String
encodeHexStr(byte[] data, boolean toLowerCase)
[将字节数组转换为十六进制字符串](Converts a byte array to a hexadecimal string)static String
encodeHexStr(String data)
[将字符串转换为十六进制字符串,结果为小写](Converts a string to a hexadecimal string and the result is lowercase)static String
encodeHexStr(String data, Charset charset)
[将字符串转换为十六进制字符串,结果为小写](Converts a string to a hexadecimal string and the result is lowercase)static String
format(String hexStr)
[格式化Hex字符串](Format hex string)static boolean
isHexNumber(String value)
[判断给定字符串是否为16进制数](Determine whether the given string is a hexadecimal number)static BigInteger
toBigInteger(String hexStr)
[Hex(16进制)字符串转为BigInteger](Hex (hexadecimal) string to BigInteger)static String
toHex(int value)
[转为16进制字符串](Convert to hexadecimal string)static String
toHex(long value)
[转为16进制字符串](Convert to hexadecimal string)static String
toUnicodeHex(char ch)
[将指定char值转换为Unicode字符串形式](Converts the specified char value to unicode string form)static String
toUnicodeHex(int value)
[将指定int值转换为Unicode字符串形式](Converts the specified int value to a Unicode string)
-
构造器详细资料
-
HexUtil
public HexUtil()[初始化项目](Initialize project)- 从以下版本开始:
- 2021/5/15 12:11 下午
-
-
方法详细资料
-
isHexNumber
[判断给定字符串是否为16进制数](Determine whether the given string is a hexadecimal number)- 参数:
value
- : 值- 返回:
- boolean
- 从以下版本开始:
- 2021/6/30 7:55 上午
-
encodeHex
public static char[] encodeHex(byte[] data)[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)- 参数:
data
- : byte[]- 返回:
- char[]
- 从以下版本开始:
- 2021/6/30 7:58 上午
-
encodeHex
[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)- 参数:
str
- : 字符串charset
- : 编码- 返回:
- char[]
- 从以下版本开始:
- 2021/6/30 8:01 上午
-
encodeHex
public static char[] encodeHex(byte[] data, boolean toLowerCase)[将字节数组转换为十六进制字符数组](Convert byte array to hexadecimal character array)- 参数:
data
- : byte[]toLowerCase
- : true 传换成小写格式 , false 传换成大写格式- 返回:
- char[]
- 从以下版本开始:
- 2021/6/30 8:02 上午
-
encodeHexStr
[将字符串转换为十六进制字符串,结果为小写](Converts a string to a hexadecimal string and the result is lowercase)- 参数:
data
- : 需要被编码的字符串charset
- : 编码- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/6/30 7:48 上午
-
encodeHexStr
[将字符串转换为十六进制字符串,结果为小写](Converts a string to a hexadecimal string and the result is lowercase)- 参数:
data
- : 被编码的字符串- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/6/30 9:33 下午
-
encodeHexStr
[将字节数组转换为十六进制字符串](Converts a byte array to a hexadecimal string)- 参数:
data
- : byte[]- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/3 8:03 上午
-
encodeHexStr
[将字节数组转换为十六进制字符串](Converts a byte array to a hexadecimal string)- 参数:
data
- : byte[]toLowerCase
- : true 传换成小写格式 , false 传换成大写格式- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/6/30 9:34 下午
-
decodeHexStr
[将十六进制字符数组转换为字符串,默认编码UTF-8](Convert hexadecimal character array to string, default encoding UTF-8)- 参数:
hexStr
- : 十六进制String- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 7:50 上午
-
decodeHexStr
[将十六进制字符数组转换为字符串](Converts a hexadecimal character array to a string)- 参数:
hexStr
- : 十六进制Stringcharset
- : 编码- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 7:51 上午
-
decodeHexStr
[将十六进制字符数组转换为字符串](Converts a hexadecimal character array to a string)- 参数:
hexData
- : 十六进制char[]charset
- : 编码- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 7:52 上午
-
decodeHex
public static byte[] decodeHex(char[] hexData)[将十六进制字符数组转换为字节数组](Converts a hexadecimal character array to a byte array)- 参数:
hexData
- : 十六进制char[]- 返回:
- byte[]
- 从以下版本开始:
- 2021/7/1 7:54 上午
-
decodeHex
[将十六进制字符串解码为byte[]](Decode hexadecimal string to byte [])- 参数:
hexStr
- : 十六进制String- 返回:
- byte[]
- 从以下版本开始:
- 2021/7/1 7:58 上午
-
encodeColor
[将Color编码为Hex形式](Encode color to hex form)- 参数:
color
- : Color- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 7:59 上午
-
encodeColor
[将Color编码为Hex形式](Encode color to hex form)- 参数:
color
- : Colorprefix
- : 前缀字符串,可以是#、0x等- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 8:03 上午
-
decodeColor
[将Hex颜色值转为Color](Convert hex color value to color)- 参数:
hexColor
- : 16进制颜色值,可以以#开头,也可以用0x开头- 返回:
- java.awt.Color
- 从以下版本开始:
- 2021/7/1 8:04 上午
-
toUnicodeHex
[将指定int值转换为Unicode字符串形式](Converts the specified int value to a Unicode string)- 参数:
value
- : int值,也可以是char- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/1 8:31 上午
-
toUnicodeHex
[将指定char值转换为Unicode字符串形式](Converts the specified char value to unicode string form)- 参数:
ch
- : char值- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/3 7:48 上午
-
toHex
[转为16进制字符串](Convert to hexadecimal string)- 参数:
value
- : int value- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/3 7:50 上午
-
toHex
[转为16进制字符串](Convert to hexadecimal string)- 参数:
value
- : long value- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/3 7:50 上午
-
appendHex
[将byte值转为16进制并添加到StringBuilder中](Convert the byte value to hexadecimal and add it to StringBuilder)- 参数:
builder
- : StringBuilderb
- : bytetoLowerCase
- : 是否使用小写- 从以下版本开始:
- 2021/7/3 7:54 上午
-
toBigInteger
[Hex(16进制)字符串转为BigInteger](Hex (hexadecimal) string to BigInteger)- 参数:
hexStr
- : Hex(16进制字符串)- 返回:
- java.math.BigInteger
- 从以下版本开始:
- 2021/7/3 7:56 上午
-
format
[格式化Hex字符串](Format hex string)- 参数:
hexStr
- : Hex字符串- 返回:
- java.lang.String
- 从以下版本开始:
- 2021/7/3 7:59 上午
-