public final class GribNumbers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MISSING
Grib uses this internally to mean missing
|
static int |
UNDEFINED
If missing value is not defined use this value.
|
static double |
UNDEFINEDD |
Constructor and Description |
---|
GribNumbers() |
Modifier and Type | Method and Description |
---|---|
static int |
convertSignedByte(byte v)
A signed byte has a sign bit then 1 15-bit value.
|
static int |
convertSignedByte2(byte v) |
static int |
countBits(byte[] bitmap) |
static float |
float4(int a,
int b,
int c,
int d)
Convert 4 bytes to a float.
|
static float |
float4(RandomAccessFile raf)
Convert 4 bytes into a float value.
|
static int |
int2(int a,
int b)
convert 2 bytes to a signed integer.
|
static int |
int2(RandomAccessFile raf)
Convert 2 bytes into a signed integer.
|
static int |
int3(int a,
int b,
int c)
Convert 3 bytes to signed integer.
|
static int |
int3(RandomAccessFile raf)
Convert 3 bytes into a signed integer.
|
static int |
int4(int a,
int b,
int c,
int d)
Convert 4 bytes into a signed integer.
|
static int |
int4(RandomAccessFile raf)
Convert 4 bytes into a signed integer.
|
static long |
int8(RandomAccessFile raf)
Convert 8 bytes into a signed long.
|
static boolean |
isUndefined(double d) |
static boolean |
testBitIsSet(int value,
int bit)
Test if the given bit is set in the test value.
|
static boolean |
testGribBitIsSet(int value,
int gribBitNumber)
Test if the given gribBitNumber is set in the test value.
|
static int |
uint(RandomAccessFile raf)
Convert unsigned bytes into an integer.
|
static int |
uint2(int a,
int b)
convert 2 bytes to an unsigned integer.
|
static int |
uint2(RandomAccessFile raf)
Convert 2 bytes into an unsigned integer.
|
static int |
uint3(int a,
int b,
int c)
Convert 3 bytes into an unsigned int.
|
static int |
uint3(RandomAccessFile raf)
Convert 3 bytes into an unsigned integer.
|
public static final int UNDEFINED
public static final double UNDEFINEDD
public static final int MISSING
public static boolean testGribBitIsSet(int value, int gribBitNumber)
value
- test the 8 bits in this value .gribBitNumber
- one based, starting from highest bit. Must be between 1-8.public static boolean testBitIsSet(int value, int bit)
value
- test the 8 bits in this value .bit
- zero based, starting from highest bit. Must be between 0-7.public static boolean isUndefined(double d)
public static int int2(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static int uint(RandomAccessFile raf) throws java.io.IOException
raf
- read one byte from herejava.io.IOException
- on read errorpublic static int int2(int a, int b)
a
- first byteb
- second bytepublic static int int3(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static int int3(int a, int b, int c)
a
- first byteb
- second bytec
- third bytepublic static int int4(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static int int4(int a, int b, int c, int d)
a
- first byteb
- second bytec
- third byted
- fourth bytepublic static int uint2(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static int uint2(int a, int b)
a
- first byteb
- second bytepublic static int uint3(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static int uint3(int a, int b, int c)
a
- first byteb
- second bytec
- third bytepublic static float float4(RandomAccessFile raf) throws java.io.IOException
raf
- read from herejava.io.IOException
- on read errorpublic static float float4(int a, int b, int c, int d)
a
- first byteb
- second bytec
- third byted
- fourth bytepublic static long int8(RandomAccessFile raf) throws java.io.IOException
raf
- RandomAccessFilejava.io.IOException
- on read errorpublic static int convertSignedByte(byte v)
v
- convert byte to signed intpublic static int convertSignedByte2(byte v)
public static int countBits(byte[] bitmap)