Package noaa.coastwatch.io.noaa1b
Class NOAA1bServices
java.lang.Object
noaa.coastwatch.io.noaa1b.NOAA1bServices
The
NOAA1bServices
class performs various NOAA 1b
file related functions.- Since:
- 3.2.2
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Date
convertDate
(int year, int day, long millisecond) Converts time in year, day, and milliseconds UTC to a Java date.static byte[]
getBytes
(ByteBuffer data, int offset, int length) Gets a byte array from the specified byte buffer.static int
getInt
(ByteBuffer data, int offset) Gets a signed 32-bit value from the specified byte buffer.static long
getNBit
(ByteBuffer data, int startOffset, int valueOffset, int bits) Gets an n-bit value from the specified byte buffer.static short
getShort
(ByteBuffer data, int offset) Gets a signed 16-bit value from the specified byte buffer.static short
getUByte
(ByteBuffer data, int offset) Gets an unsigned 8-bit value from the specified byte buffer.static long
getUInt
(ByteBuffer data, int offset) Gets an unsigned 32-bit value from the specified byte buffer.static int
getUShort
(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.
-
Constructor Details
-
NOAA1bServices
public NOAA1bServices()
-
-
Method Details
-
isPrint
public static boolean isPrint(byte b) Determines if a byte is a valid printable ASCII character. -
getBytes
Gets a byte array from the specified byte buffer. -
getUByte
Gets an unsigned 8-bit value from the specified byte buffer. -
getUShort
Gets an unsigned 16-bit value from the specified byte buffer. -
getShort
Gets a signed 16-bit value from the specified byte buffer. -
getUInt
Gets an unsigned 32-bit value from the specified byte buffer. -
getNBit
Gets an n-bit value from the specified byte buffer.- Parameters:
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].
-
getInt
Gets a signed 32-bit value from the specified byte buffer. -
convertDate
Converts time in year, day, and milliseconds UTC to a Java date.- Parameters:
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.- Returns:
- a date object for the specified data.
-