Class NTV2Util


  • public final class NTV2Util
    extends java.lang.Object
    A set of static utility methods for reading the NTv2 file format
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NTV2Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double getDouble​(byte[] b, boolean bigEndian)
      Get a double from the first 8 bytes of a byte array, in either Big Endian or Little Endian format.
      static float getFloat​(byte[] b, boolean bigEndian)
      Get a float from the first 4 bytes of a byte array, in either Big Endian or Little Endian format.
      static int getInt​(byte[] b, boolean bigEndian)
      Get an int from the first 4 bytes of a byte array, in either Big Endian or Little Endian format.
      static int getIntBE​(byte[] b, int i)
      Get a Big Endian int from four bytes of a byte array
      static int getIntLE​(byte[] b, int i)
      Get a Little Endian int from four bytes of a byte array
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getIntLE

        public static int getIntLE​(byte[] b,
                                   int i)
        Get a Little Endian int from four bytes of a byte array
        Parameters:
        b - the byte array
        i - the index of the first data byte in the array
        Returns:
        the int
      • getIntBE

        public static int getIntBE​(byte[] b,
                                   int i)
        Get a Big Endian int from four bytes of a byte array
        Parameters:
        b - the byte array
        i - the index of the first data byte in the array
        Returns:
        the int
      • getInt

        public static int getInt​(byte[] b,
                                 boolean bigEndian)
        Get an int from the first 4 bytes of a byte array, in either Big Endian or Little Endian format.
        Parameters:
        b - the byte array
        bigEndian - is the byte array Big Endian?
        Returns:
        the int
      • getFloat

        public static float getFloat​(byte[] b,
                                     boolean bigEndian)
        Get a float from the first 4 bytes of a byte array, in either Big Endian or Little Endian format.
        Parameters:
        b - the byte array
        bigEndian - is the byte array Big Endian?
        Returns:
        the float
      • getDouble

        public static double getDouble​(byte[] b,
                                       boolean bigEndian)
        Get a double from the first 8 bytes of a byte array, in either Big Endian or Little Endian format.
        Parameters:
        b - the byte array
        bigEndian - is the byte array Big Endian?
        Returns:
        the double