Class BitConverter
java.lang.Object
org.opengis.cite.gmljpx20.util.jp2.BitConverter
BitConverter class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longdoubleToInt64Bits(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 doubleint64BitsToDouble(long x) int64BitsToDouble.booleantoBoolean(byte[] bytes, int index) toBoolean.chartoChar(byte[] bytes, int index) toChar.doubletoDouble(byte[] bytes, int index) toDouble.static shorttoInt16(byte[] bytes, int index) toInt16.static inttoInt32(byte[] bytes, int index) toInt32.static longtoInt64(byte[] bytes, int index) toInt64.static floattoSingle(byte[] bytes, int index) toSingle.static StringtoString(byte[] bytes) toString.static longToUInt32(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
byteobjects
-
getBytes
public static byte[] getBytes(char c) getBytes.
- Parameters:
c- a char- Returns:
- an array of
byteobjects
-
getBytes
public static byte[] getBytes(double x) getBytes.
- Parameters:
x- a double- Returns:
- an array of
byteobjects
-
getBytes
public static byte[] getBytes(short x) getBytes.
- Parameters:
x- a short- Returns:
- an array of
byteobjects
-
getBytes
public static byte[] getBytes(int x) getBytes.
- Parameters:
x- a int- Returns:
- an array of
byteobjects
-
getBytes
public static byte[] getBytes(long x) getBytes.
- Parameters:
x- a long- Returns:
- an array of
byteobjects
-
getBytes
public static byte[] getBytes(float x) getBytes.
- Parameters:
x- a float- Returns:
- an array of
byteobjects
-
getBytes
getBytes.
- Parameters:
x- aStringobject- Returns:
- an array of
byteobjects
-
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 ofbyteobjectsindex- a int- Returns:
- a boolean
- Throws:
Exception- if any.
-
toChar
toChar.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a char
- Throws:
Exception- if any.
-
toDouble
toDouble.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a double
- Throws:
Exception- if any.
-
toInt16
toInt16.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a short
- Throws:
Exception- if any.
-
toInt32
toInt32.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a int
- Throws:
Exception- if any.
-
ToUInt32
public static long ToUInt32(byte[] bytes, int index) ToUInt32.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a long
-
toInt64
toInt64.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a long
- Throws:
Exception- if any.
-
toSingle
toSingle.
- Parameters:
bytes- an array ofbyteobjectsindex- a int- Returns:
- a float
- Throws:
Exception- if any.
-
toString
toString.
-