Class NTV2Util
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.datum.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 arraystatic int
getIntLE(byte[] b, int i)
Get a Little Endian int from four bytes of a byte array
-
-
-
Constructor Detail
-
NTV2Util
private NTV2Util()
-
-
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 arrayi
- 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 arrayi
- 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 arraybigEndian
- 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 arraybigEndian
- 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 arraybigEndian
- is the byte array Big Endian?- Returns:
- the double
-
-