Class BitConverter

java.lang.Object
org.opengis.cite.gmljpx20.util.jp2.BitConverter

public class BitConverter extends Object

BitConverter class.

  • Constructor Details

    • BitConverter

      public BitConverter()
  • Method Details

    • getBytes

      public static byte[] getBytes(boolean x)

      getBytes.

      Parameters:
      x - a boolean
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(char c)

      getBytes.

      Parameters:
      c - a char
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(double x)

      getBytes.

      Parameters:
      x - a double
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(short x)

      getBytes.

      Parameters:
      x - a short
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(int x)

      getBytes.

      Parameters:
      x - a int
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(long x)

      getBytes.

      Parameters:
      x - a long
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(float x)

      getBytes.

      Parameters:
      x - a float
      Returns:
      an array of byte objects
    • getBytes

      public static byte[] getBytes(String x)

      getBytes.

      Parameters:
      x - a String object
      Returns:
      an array of byte objects
    • doubleToInt64Bits

      public static long doubleToInt64Bits(double x)

      doubleToInt64Bits.

      Parameters:
      x - a double
      Returns:
      a long
    • int64BitsToDouble

      public static double int64BitsToDouble(long x)

      int64BitsToDouble.

      Parameters:
      x - a long
      Returns:
      a double
    • toBoolean

      public boolean toBoolean(byte[] bytes, int index) throws Exception

      toBoolean.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a boolean
      Throws:
      Exception - if any.
    • toChar

      public char toChar(byte[] bytes, int index) throws Exception

      toChar.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a char
      Throws:
      Exception - if any.
    • toDouble

      public double toDouble(byte[] bytes, int index) throws Exception

      toDouble.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a double
      Throws:
      Exception - if any.
    • toInt16

      public static short toInt16(byte[] bytes, int index) throws Exception

      toInt16.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a short
      Throws:
      Exception - if any.
    • toInt32

      public static int toInt32(byte[] bytes, int index) throws Exception

      toInt32.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a int
      Throws:
      Exception - if any.
    • ToUInt32

      public static long ToUInt32(byte[] bytes, int index)

      ToUInt32.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a long
    • toInt64

      public static long toInt64(byte[] bytes, int index) throws Exception

      toInt64.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a long
      Throws:
      Exception - if any.
    • toSingle

      public static float toSingle(byte[] bytes, int index) throws Exception

      toSingle.

      Parameters:
      bytes - an array of byte objects
      index - a int
      Returns:
      a float
      Throws:
      Exception - if any.
    • toString

      public static String toString(byte[] bytes) throws Exception

      toString.

      Parameters:
      bytes - an array of byte objects
      Returns:
      a String object
      Throws:
      Exception - if any.