类 NumUtils

java.lang.Object
cn.zhxu.toys.util.NumUtils

public class NumUtils extends Object
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final int
     
    static final int
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static int
    from256Num(byte... data)
    256进制转换(大端模式)
    static long
    from256Num(byte[] data, int from, int to)
    256进制转换(大端模式)
    static long
    from256NumLite(byte[] data, int from, int to)
    256进制转换(小端模式)
    static long
    from62Num(byte... data)
    62进制转换(大端模式)
    static long
    62进制数字字符串转 LONG 数值(大端模式)
    static boolean
    not62Num(byte... data)
    判断一个字节数组是否不是62进制数
    static byte[]
    to256Num(long value, int length)
    int 值转 256 进制字节数组(大端模式) 数据的高字节保存在内存的低地址中,而数据的低字节保存在内存的高地址中
    static byte[]
    to256NumLite(long value, int length)
    int 值转 256 进制字节数组(小端模式:低位在前,高位在后)
    static byte
    to62(int v)
     
    static byte[]
    to62Num(long value)
    int 值转 62 进制字节数组(大端模式)
    static byte[]
    to62Num(long value, int length)
    int 值转 62 进制字节数组(大端模式)
    static String
    to62NumStr(long value)
    int 值转 62 进制数字字符串(大端模式)
    static int
    unsigned(byte value)
    无符号整数

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • RADIX_62

      public static final int RADIX_62
      另请参阅:
    • RADIX_256

      public static final int RADIX_256
      另请参阅:
  • 构造器详细资料

    • NumUtils

      public NumUtils()
  • 方法详细资料

    • from62Num

      public static long from62Num(byte... data)
      62进制转换(大端模式)
      参数:
      data - 序号低的为高位,序号高的为低位,最多5字节
      返回:
      数值
    • not62Num

      public static boolean not62Num(byte... data)
      判断一个字节数组是否不是62进制数
      参数:
      data - 数据
      返回:
      是否不是62进制数
    • to62Num

      public static byte[] to62Num(long value)
      int 值转 62 进制字节数组(大端模式)
      参数:
      value - 数值
      返回:
      字节数组
    • to62NumStr

      public static String to62NumStr(long value)
      int 值转 62 进制数字字符串(大端模式)
      参数:
      value - 数值
      返回:
      数字字符串
    • from62NumStr

      public static long from62NumStr(String num)
      62进制数字字符串转 LONG 数值(大端模式)
      参数:
      num - 数字字符串
      返回:
      LONG 数值
    • to62Num

      public static byte[] to62Num(long value, int length)
      int 值转 62 进制字节数组(大端模式)
      参数:
      value - 数值
      length - 目标数组长度
      返回:
      字节数组
    • unsigned

      public static int unsigned(byte value)
      无符号整数
    • from256Num

      public static int from256Num(byte... data)
      256进制转换(大端模式)
      参数:
      data - 序号低的为高位,序号高的为低位,最多5字节
      返回:
      数值
    • from256Num

      public static long from256Num(byte[] data, int from, int to)
      256进制转换(大端模式)
      参数:
      data - 序号低的为高位,序号高的为低位
      返回:
    • to256Num

      public static byte[] to256Num(long value, int length)
      int 值转 256 进制字节数组(大端模式) 数据的高字节保存在内存的低地址中,而数据的低字节保存在内存的高地址中
      参数:
      value - 数值
      length - 目标数组长度
      返回:
      字节数组
    • from256NumLite

      public static long from256NumLite(byte[] data, int from, int to)
      256进制转换(小端模式)
      参数:
      data - 低位在前,高位在后
      返回:
    • to256NumLite

      public static byte[] to256NumLite(long value, int length)
      int 值转 256 进制字节数组(小端模式:低位在前,高位在后)
      参数:
      value - 数值
      length - 目标数组长度
      返回:
      字节数组
    • to62

      public static byte to62(int v)