类 ByteUtils


  • public class ByteUtils
    extends Object
    Provides byte array operation utilities
    • 构造器详细资料

      • ByteUtils

        public ByteUtils()
    • 方法详细资料

      • toBytesFromHex

        public static byte[] toBytesFromHex​(String data)
        Get byte array from hex string
        参数:
        data - specified hex string data
        返回:
        byte array
      • toHexStringFromBytes

        public static String toHexStringFromBytes​(byte[] data)
        Get hex string from byte array
        参数:
        data - specified byte array
        返回:
        hex string
      • toBytesFromInt

        public static byte[] toBytesFromInt​(int number)
        Get byte array from int type value
        参数:
        number - specified in type value
        返回:
        byte array
      • toLongFromBytes

        public static long toLongFromBytes​(byte[] data)
        Get long value from byte array
        参数:
        data - specified byte array
        返回:
        successful long type value, otherwise an exception will be thrown
      • getCounterBytes

        public static byte[] getCounterBytes​(long counter)
        Get byte array from counter value
        参数:
        counter - specified counter value
        返回:
        successful byte value array, otherwise an exception will be thrown