Package javajs.util
Class BC
java.lang.Object
javajs.util.BC
- Direct Known Subclasses:
BinaryDocument
byte converter
- Author:
- Bob Hanson hansonr@stolaf.edu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float
bytesToDoubleToFloat
(byte[] bytes, int j, boolean isBigEndian) see http://en.wikipedia.org/wiki/Binary64 not concerning ourselves with very small or very large numbers and getting this exactly right.static float
bytesToFloat
(byte[] bytes, int j, boolean isBigEndian) static int
bytesToInt
(byte[] bytes, int j, boolean isBigEndian) static int
bytesToShort
(byte[] bytes, int j, boolean isBigEndian) static float
intToFloat
(int x) static int
intToSignedInt
(int n)
-
Constructor Details
-
BC
public BC()
-
-
Method Details
-
bytesToFloat
- Throws:
Exception
-
bytesToShort
public static int bytesToShort(byte[] bytes, int j, boolean isBigEndian) -
bytesToInt
public static int bytesToInt(byte[] bytes, int j, boolean isBigEndian) -
intToSignedInt
public static int intToSignedInt(int n) -
intToFloat
- Throws:
Exception
-
bytesToDoubleToFloat
public static float bytesToDoubleToFloat(byte[] bytes, int j, boolean isBigEndian) see http://en.wikipedia.org/wiki/Binary64 not concerning ourselves with very small or very large numbers and getting this exactly right. Just need a float here.- Parameters:
bytes
-j
-isBigEndian
-- Returns:
- float
-