Class BitConverter
java.lang.Object
org.opengis.cite.gmljpx20.util.jp2.BitConverter
BitConverter class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
doubleToInt64Bits
(double x) doubleToInt64Bits.static byte[]
getBytes
(boolean x) getBytes.static byte[]
getBytes
(char c) getBytes.static byte[]
getBytes
(double x) getBytes.static byte[]
getBytes
(float x) getBytes.static byte[]
getBytes
(int x) getBytes.static byte[]
getBytes
(long x) getBytes.static byte[]
getBytes
(short x) getBytes.static byte[]
getBytes.static double
int64BitsToDouble
(long x) int64BitsToDouble.boolean
toBoolean
(byte[] bytes, int index) toBoolean.char
toChar
(byte[] bytes, int index) toChar.double
toDouble
(byte[] bytes, int index) toDouble.static short
toInt16
(byte[] bytes, int index) toInt16.static int
toInt32
(byte[] bytes, int index) toInt32.static long
toInt64
(byte[] bytes, int index) toInt64.static float
toSingle
(byte[] bytes, int index) toSingle.static String
toString
(byte[] bytes) toString.static long
ToUInt32
(byte[] bytes, int index) ToUInt32.
-
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
getBytes.
- Parameters:
x
- aString
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
toBoolean.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a boolean
- Throws:
Exception
- if any.
-
toChar
toChar.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a char
- Throws:
Exception
- if any.
-
toDouble
toDouble.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a double
- Throws:
Exception
- if any.
-
toInt16
toInt16.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a short
- Throws:
Exception
- if any.
-
toInt32
toInt32.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a int
- Throws:
Exception
- if any.
-
ToUInt32
public static long ToUInt32(byte[] bytes, int index) ToUInt32.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a long
-
toInt64
toInt64.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a long
- Throws:
Exception
- if any.
-
toSingle
toSingle.
- Parameters:
bytes
- an array ofbyte
objectsindex
- a int- Returns:
- a float
- Throws:
Exception
- if any.
-
toString
toString.
-