Class NTV2Util
java.lang.Object
org.openstreetmap.josm.data.projection.datum.NTV2Util
A set of static utility methods for reading the NTv2 file format
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetDouble(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 floatgetFloat(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 intgetInt(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 intgetIntBE(byte[] b, int i) Get a Big Endian int from four bytes of a byte arraystatic intgetIntLE(byte[] b, int i) Get a Little Endian int from four bytes of a byte array
-
Constructor Details
-
NTV2Util
private NTV2Util()
-
-
Method Details
-
getIntLE
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
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
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
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
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
-