Package javajs.util

Class BC

java.lang.Object
javajs.util.BC
Direct Known Subclasses:
BinaryDocument

public class BC extends Object
byte converter
Author:
Bob Hanson hansonr@stolaf.edu
  • Constructor Summary

    Constructors
    Constructor
    Description
    BC()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BC

      public BC()
  • Method Details

    • bytesToFloat

      public static float bytesToFloat(byte[] bytes, int j, boolean isBigEndian) throws Exception
      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

      public static float intToFloat(int x) throws Exception
      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