Class NOAA1bServices

java.lang.Object
noaa.coastwatch.io.noaa1b.NOAA1bServices

public class NOAA1bServices extends Object
The NOAA1bServices class performs various NOAA 1b file related functions.
Since:
3.2.2
Author:
Peter Hollemans
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static byte[] getBytes(ByteBuffer data, int offset, int length)
      Gets a byte array from the specified byte buffer.
    • getUByte

      public static short getUByte(ByteBuffer data, int offset)
      Gets an unsigned 8-bit value from the specified byte buffer.
    • getUShort

      public static int getUShort(ByteBuffer data, int offset)
      Gets an unsigned 16-bit value from the specified byte buffer.
    • getShort

      public static short getShort(ByteBuffer data, int offset)
      Gets a signed 16-bit value from the specified byte buffer.
    • getUInt

      public static long getUInt(ByteBuffer data, int offset)
      Gets an unsigned 32-bit value from the specified byte buffer.
    • getNBit

      public static long getNBit(ByteBuffer data, int startOffset, int valueOffset, int bits)
      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

      public static int getInt(ByteBuffer data, int offset)
      Gets a signed 32-bit value from the specified byte buffer.
    • convertDate

      public static Date convertDate(int year, int day, long millisecond)
      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.