类 Base16
java.lang.Object
tech.mhuang.pacebox.core.codec.Base16
- 所有已实现的接口:
Decoder<CharSequence,,byte[]> Encoder<byte[],char[]>
16进制
- 从以下版本开始:
- 1.0.0
- 作者:
- mhuang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidappendHex(StringBuilder builder, byte b) 将byte值转为16进制并添加到StringBuilder中byte[]decode(CharSequence data) 解码char[]encode(byte[] data) 编码toUnicodeHex(char ch) 将指定char值转换为Unicode字符串形式,常用于特殊字符(例如汉字)转Unicode形式
转换的字符串如果u后不足4位,则前面用0填充,例如:
-
字段详细资料
-
CODEC_LOWER
-
CODEC_UPPER
-
-
构造器详细资料
-
Base16
public Base16(boolean lowerCase) 是否小写- 参数:
lowerCase- 是否小写
-
-
方法详细资料
-
decode
从接口复制的说明:Decoder解码- 指定者:
decode在接口中Decoder<CharSequence,byte[]> - 参数:
data- 需要解码的数据- 返回:
- 解码结果
-
encode
public char[] encode(byte[] data) 从接口复制的说明:Encoder编码 -
toUnicodeHex
将指定char值转换为Unicode字符串形式,常用于特殊字符(例如汉字)转Unicode形式
转换的字符串如果u后不足4位,则前面用0填充,例如:- 参数:
ch- char值- 返回:
- Unicode表现形式
-
appendHex
将byte值转为16进制并添加到StringBuilder中- 参数:
builder-StringBuilderb- byte
-