Class ByteUtils


  • public final class ByteUtils
    extends Object
    • Method Detail

      • toAsciiBytes

        public static byte[] toAsciiBytes​(String string)
      • fromAsciiBytes

        public static String fromAsciiBytes​(byte[] bytes)
      • toUTF8Bytes

        public static byte[] toUTF8Bytes​(String string)
      • fromUTF8Bytes

        public static String fromUTF8Bytes​(byte[] bytes)
      • toBytes

        public static byte[] toBytes​(String string,
                                     String encoding)
      • fromBytes

        public static String fromBytes​(byte[] bytes,
                                       String encoding)
      • toHex

        public static String toHex​(byte[] bytes)
      • fromHex

        public static byte[] fromHex​(String hex)
      • toBigEndian

        public static byte[] toBigEndian​(int i)
      • fromBigEndian

        public static int fromBigEndian​(byte[] b)
      • selectByte

        public static byte selectByte​(int byteSignificance,
                                      int from)
      • toInt

        public static int toInt​(int byteSignificance,
                                byte b)
      • copy

        public static byte[] copy​(byte[] orig)
        null-safe byte[] copy