public class NOAA1bServices
extends java.lang.Object
NOAA1bServices
class performs various NOAA 1b
file related functions.Constructor and Description |
---|
NOAA1bServices() |
Modifier and Type | Method and Description |
---|---|
static java.util.Date |
convertDate(int year,
int day,
long millisecond)
Converts time in year, day, and milliseconds UTC to a Java
date.
|
static byte[] |
getBytes(java.nio.ByteBuffer data,
int offset,
int length)
Gets a byte array from the specified byte buffer.
|
static int |
getInt(java.nio.ByteBuffer data,
int offset)
Gets a signed 32-bit value from the specified byte buffer.
|
static long |
getNBit(java.nio.ByteBuffer data,
int startOffset,
int valueOffset,
int bits)
Gets an n-bit value from the specified byte buffer.
|
static short |
getShort(java.nio.ByteBuffer data,
int offset)
Gets a signed 16-bit value from the specified byte buffer.
|
static short |
getUByte(java.nio.ByteBuffer data,
int offset)
Gets an unsigned 8-bit value from the specified byte buffer.
|
static long |
getUInt(java.nio.ByteBuffer data,
int offset)
Gets an unsigned 32-bit value from the specified byte buffer.
|
static int |
getUShort(java.nio.ByteBuffer data,
int offset)
Gets an unsigned 16-bit value from the specified byte buffer.
|
static boolean |
isPrint(byte b)
Determines if a byte is a valid printable ASCII character.
|
public static boolean isPrint(byte b)
public static byte[] getBytes(java.nio.ByteBuffer data, int offset, int length)
public static short getUByte(java.nio.ByteBuffer data, int offset)
public static int getUShort(java.nio.ByteBuffer data, int offset)
public static short getShort(java.nio.ByteBuffer data, int offset)
public static long getUInt(java.nio.ByteBuffer data, int offset)
public static long getNBit(java.nio.ByteBuffer data, int startOffset, int valueOffset, int bits)
data
- the byte buffer to extract data from.startOffset
- the starting offset into the byte buffer to count
n-bit data values from.valueOffset
- the number of n-bit values into the array to
extract an integer from.bits
- the number of bits in each value in the range [1..64].public static int getInt(java.nio.ByteBuffer data, int offset)
public static java.util.Date convertDate(int year, int day, long millisecond)
year
- the four digit year.day
- the day of the year starting at 1.millisecond
- the millisecond of the day starting at
00:00 UTC.