类 Base16

java.lang.Object
tech.mhuang.pacebox.core.codec.Base16
所有已实现的接口:
Decoder<CharSequence,byte[]>, Encoder<byte[],char[]>

public class Base16 extends Object implements Encoder<byte[],char[]>, Decoder<CharSequence,byte[]>
16进制
从以下版本开始:
1.0.0
作者:
mhuang
  • 字段详细资料

    • CODEC_LOWER

      public static final Base16 CODEC_LOWER
    • CODEC_UPPER

      public static final Base16 CODEC_UPPER
  • 构造器详细资料

    • Base16

      public Base16(boolean lowerCase)
      是否小写
      参数:
      lowerCase - 是否小写
  • 方法详细资料

    • decode

      public byte[] decode(CharSequence data)
      从接口复制的说明: Decoder
      解码
      指定者:
      decode 在接口中 Decoder<CharSequence,byte[]>
      参数:
      data - 需要解码的数据
      返回:
      解码结果
    • encode

      public char[] encode(byte[] data)
      从接口复制的说明: Encoder
      编码
      指定者:
      encode 在接口中 Encoder<byte[],char[]>
      参数:
      data - 编码数据
      返回:
      解码数据
    • toUnicodeHex

      public String toUnicodeHex(char ch)
      将指定char值转换为Unicode字符串形式,常用于特殊字符(例如汉字)转Unicode形式
      转换的字符串如果u后不足4位,则前面用0填充,例如:
      参数:
      ch - char值
      返回:
      Unicode表现形式
    • appendHex

      public void appendHex(StringBuilder builder, byte b)
      将byte值转为16进制并添加到StringBuilder
      参数:
      builder - StringBuilder
      b - byte