Class ByteConversions

java.lang.Object
org.apache.commons.imaging.common.ByteConversions

public final class ByteConversions extends Object
Convenience methods for converting data types to and from byte arrays.
  • Constructor Details

    • ByteConversions

      private ByteConversions()
  • Method Details

    • toBytes

      public static byte[] toBytes(short value, ByteOrder byteOrder)
    • toBytes

      public static byte[] toBytes(short[] values, ByteOrder byteOrder)
    • toBytes

      private static byte[] toBytes(short[] values, int offset, int length, ByteOrder byteOrder)
    • toBytes

      private static void toBytes(short value, ByteOrder byteOrder, byte[] result, int offset)
    • toBytes

      public static byte[] toBytes(int value, ByteOrder byteOrder)
    • toBytes

      public static byte[] toBytes(int[] values, ByteOrder byteOrder)
    • toBytes

      private static byte[] toBytes(int[] values, int offset, int length, ByteOrder byteOrder)
    • toBytes

      private static void toBytes(int value, ByteOrder byteOrder, byte[] result, int offset)
    • toBytes

      public static byte[] toBytes(float value, ByteOrder byteOrder)
    • toBytes

      public static byte[] toBytes(float[] values, ByteOrder byteOrder)
    • toBytes

      private static byte[] toBytes(float[] values, int offset, int length, ByteOrder byteOrder)
    • toBytes

      private static void toBytes(float value, ByteOrder byteOrder, byte[] result, int offset)
    • toBytes

      public static byte[] toBytes(double value, ByteOrder byteOrder)
    • toBytes

      public static byte[] toBytes(double[] values, ByteOrder byteOrder)
    • toBytes

      private static byte[] toBytes(double[] values, int offset, int length, ByteOrder byteOrder)
    • toBytes

      private static void toBytes(double value, ByteOrder byteOrder, byte[] result, int offset)
    • toBytes

      public static byte[] toBytes(RationalNumber value, ByteOrder byteOrder)
    • toBytes

      public static byte[] toBytes(RationalNumber[] values, ByteOrder byteOrder)
    • toBytes

      private static byte[] toBytes(RationalNumber[] values, int offset, int length, ByteOrder byteOrder)
    • toBytes

      private static void toBytes(RationalNumber value, ByteOrder byteOrder, byte[] result, int offset)
    • toShort

      public static short toShort(byte[] bytes, ByteOrder byteOrder)
    • toShort

      private static short toShort(byte[] bytes, int offset, ByteOrder byteOrder)
    • toShorts

      public static short[] toShorts(byte[] bytes, ByteOrder byteOrder)
    • toShorts

      private static short[] toShorts(byte[] bytes, int offset, int length, ByteOrder byteOrder)
    • toUInt16

      public static int toUInt16(byte[] bytes, ByteOrder byteOrder)
    • toUInt16

      public static int toUInt16(byte[] bytes, int offset, ByteOrder byteOrder)
    • toUInt16s

      public static int[] toUInt16s(byte[] bytes, ByteOrder byteOrder)
    • toUInt16s

      private static int[] toUInt16s(byte[] bytes, int offset, int length, ByteOrder byteOrder)
    • toInt

      public static int toInt(byte[] bytes, ByteOrder byteOrder)
    • toInt

      public static int toInt(byte[] bytes, int offset, ByteOrder byteOrder)
    • toInts

      public static int[] toInts(byte[] bytes, ByteOrder byteOrder)
    • toInts

      private static int[] toInts(byte[] bytes, int offset, int length, ByteOrder byteOrder)
    • toFloat

      public static float toFloat(byte[] bytes, ByteOrder byteOrder)
    • toFloat

      private static float toFloat(byte[] bytes, int offset, ByteOrder byteOrder)
    • toFloats

      public static float[] toFloats(byte[] bytes, ByteOrder byteOrder)
    • toFloats

      private static float[] toFloats(byte[] bytes, int offset, int length, ByteOrder byteOrder)
    • toDouble

      public static double toDouble(byte[] bytes, ByteOrder byteOrder)
    • toDouble

      private static double toDouble(byte[] bytes, int offset, ByteOrder byteOrder)
    • toDoubles

      public static double[] toDoubles(byte[] bytes, ByteOrder byteOrder)
    • toDoubles

      private static double[] toDoubles(byte[] bytes, int offset, int length, ByteOrder byteOrder)
    • toRational

      public static RationalNumber toRational(byte[] bytes, ByteOrder byteOrder)
    • toRational

      private static RationalNumber toRational(byte[] bytes, int offset, ByteOrder byteOrder)
    • toRationals

      public static RationalNumber[] toRationals(byte[] bytes, ByteOrder byteOrder)
    • toRationals

      private static RationalNumber[] toRationals(byte[] bytes, int offset, int length, ByteOrder byteOrder)