Class Bytes


  • public class Bytes
    extends java.lang.Object
    bytes
    Since:
    1.0
    Author:
    PARK Yong Seo
    • Method Summary

      Modifier and Type Method Description
      static byte[] decodeBase64​(java.lang.String base64)
      base64String to byte data
      static java.lang.String decodeBase64​(java.lang.String base64, java.lang.String charset)
      base64 to text
      static java.lang.String encodeBase64String​(byte[] data)
      byte data to base64String
      static java.lang.String encodeBase64String​(java.lang.String text, java.lang.String charset)
      text to base64String
      static byte[] toBytes​(double val)
      double to bytes
      static byte[] toBytes​(double[] val)
      double[] to bytes
      static byte[] toBytes​(double[] val, int offset, int length)
      double[] to bytes
      static byte[] toBytes​(float val)
      float to bytes
      static byte[] toBytes​(float[] val)
      float[] to bytes
      static byte[] toBytes​(float[] val, int offset, int length)
      float[] to bytes
      static byte[] toBytes​(int val)
      int to bytes
      static byte[] toBytes​(int[] val)
      int[] to bytes
      static byte[] toBytes​(int[] val, int offset, int length)
      int[] to bytes
      static byte[] toBytes​(long val)
      long to bytes
      static byte[] toBytes​(long[] val)
      long[] to bytes
      static byte[] toBytes​(long[] val, int offset, int length)
      long[] to bytes
      static byte[] toBytes​(short val)
      short to bytes
      static byte[] toBytes​(short[] val)
      short[] to bytes
      static byte[] toBytes​(short[] val, int offset, int length)
      short[] to bytes
      static byte[] toBytesByHex​(java.lang.String hex)
      to bytes by hex string
      static double toDouble​(byte[] val)
      bytes to double
      static double toDouble​(byte[] val, int offset)
      bytes to double
      static double[] toDoubleArray​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to double[]
      static java.util.List<java.lang.Double> toDoubleList​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to double list
      static float toFloat​(byte[] val)
      bytes to float
      static float toFloat​(byte[] val, int offset)
      bytes to float
      static float[] toFloatArray​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to float[]
      static java.util.List<java.lang.Float> toFloatList​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to float list
      static java.lang.String toHex​(byte[] bytes)
      bytes to hex
      static int toInt​(byte[] val)
      bytes to int
      static int toInt​(byte[] val, int offset)
      bytes to int
      static int[] toIntArray​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to int[]
      static java.util.List<java.lang.Integer> toIntegerList​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to integer list
      static long toLong​(byte[] val)
      bytes to long
      static long toLong​(byte[] val, int offset)
      bytes to long
      static long[] toLongArray​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to long[]
      static java.util.List<java.lang.Long> toLongList​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to long list
      static short toShort​(byte[] val)
      bytes to short
      static short toShort​(byte[] val, int offset)
      bytes to short
      static short[] toShortArray​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to short[]
      static java.util.List<java.lang.Short> toShortList​(byte[] bytes, int bytesOffset, int arrayLength)
      bytes to short list
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toHex

        public static java.lang.String toHex​(byte[] bytes)
        bytes to hex
        Parameters:
        bytes -
        Returns:
      • toBytesByHex

        public static byte[] toBytesByHex​(java.lang.String hex)
        to bytes by hex string
        Parameters:
        hex -
        Returns:
      • encodeBase64String

        public static java.lang.String encodeBase64String​(byte[] data)
        byte data to base64String
        Parameters:
        data -
        Returns:
      • encodeBase64String

        public static java.lang.String encodeBase64String​(java.lang.String text,
                                                          java.lang.String charset)
        text to base64String
        Parameters:
        data -
        charset -
        Returns:
      • decodeBase64

        public static byte[] decodeBase64​(java.lang.String base64)
        base64String to byte data
        Parameters:
        base64 -
        Returns:
      • decodeBase64

        public static java.lang.String decodeBase64​(java.lang.String base64,
                                                    java.lang.String charset)
        base64 to text
        Parameters:
        base64 -
        charset -
        Returns:
      • toBytes

        public static byte[] toBytes​(short val)
        short to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(short[] val)
        short[] to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(short[] val,
                                     int offset,
                                     int length)
        short[] to bytes
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toBytes

        public static byte[] toBytes​(int val)
        int to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(int[] val)
        int[] to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(int[] val,
                                     int offset,
                                     int length)
        int[] to bytes
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toBytes

        public static byte[] toBytes​(long val)
        long to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(long[] val)
        long[] to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(long[] val,
                                     int offset,
                                     int length)
        long[] to bytes
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toBytes

        public static byte[] toBytes​(float val)
        float to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(float[] val)
        float[] to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(float[] val,
                                     int offset,
                                     int length)
        float[] to bytes
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toBytes

        public static byte[] toBytes​(double val)
        double to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(double[] val)
        double[] to bytes
        Parameters:
        val -
        Returns:
      • toBytes

        public static byte[] toBytes​(double[] val,
                                     int offset,
                                     int length)
        double[] to bytes
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toShort

        public static short toShort​(byte[] val,
                                    int offset)
        bytes to short
        Parameters:
        val -
        offset -
        Returns:
      • toShortArray

        public static short[] toShortArray​(byte[] bytes,
                                           int bytesOffset,
                                           int arrayLength)
        bytes to short[]
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toShortList

        public static java.util.List<java.lang.Short> toShortList​(byte[] bytes,
                                                                  int bytesOffset,
                                                                  int arrayLength)
        bytes to short list
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toShort

        public static short toShort​(byte[] val)
        bytes to short
        Parameters:
        val -
        Returns:
      • toInt

        public static int toInt​(byte[] val,
                                int offset)
        bytes to int
        Parameters:
        val -
        offset -
        Returns:
      • toIntArray

        public static int[] toIntArray​(byte[] bytes,
                                       int bytesOffset,
                                       int arrayLength)
        bytes to int[]
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toIntegerList

        public static java.util.List<java.lang.Integer> toIntegerList​(byte[] bytes,
                                                                      int bytesOffset,
                                                                      int arrayLength)
        bytes to integer list
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toInt

        public static int toInt​(byte[] val)
        bytes to int
        Parameters:
        val -
        Returns:
      • toLong

        public static long toLong​(byte[] val,
                                  int offset)
        bytes to long
        Parameters:
        val -
        offset -
        Returns:
      • toLongArray

        public static long[] toLongArray​(byte[] bytes,
                                         int bytesOffset,
                                         int arrayLength)
        bytes to long[]
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toLongList

        public static java.util.List<java.lang.Long> toLongList​(byte[] bytes,
                                                                int bytesOffset,
                                                                int arrayLength)
        bytes to long list
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toLong

        public static long toLong​(byte[] val)
        bytes to long
        Parameters:
        val -
        Returns:
      • toFloat

        public static float toFloat​(byte[] val,
                                    int offset)
        bytes to float
        Parameters:
        val -
        offset -
        Returns:
      • toFloatArray

        public static float[] toFloatArray​(byte[] bytes,
                                           int bytesOffset,
                                           int arrayLength)
        bytes to float[]
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toFloatList

        public static java.util.List<java.lang.Float> toFloatList​(byte[] bytes,
                                                                  int bytesOffset,
                                                                  int arrayLength)
        bytes to float list
        Parameters:
        val -
        offset -
        arrayLength -
        Returns:
      • toFloat

        public static float toFloat​(byte[] val)
        bytes to float
        Parameters:
        val -
        Returns:
      • toDouble

        public static double toDouble​(byte[] val,
                                      int offset)
        bytes to double
        Parameters:
        val -
        offset -
        Returns:
      • toDoubleArray

        public static double[] toDoubleArray​(byte[] bytes,
                                             int bytesOffset,
                                             int arrayLength)
        bytes to double[]
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toDoubleList

        public static java.util.List<java.lang.Double> toDoubleList​(byte[] bytes,
                                                                    int bytesOffset,
                                                                    int arrayLength)
        bytes to double list
        Parameters:
        val -
        offset -
        length -
        Returns:
      • toDouble

        public static double toDouble​(byte[] val)
        bytes to double
        Parameters:
        val -
        Returns: