Class NOWRadheader


  • public class NOWRadheader
    extends Object
    Created by IntelliJ IDEA. User: yuanho Date: Feb 10, 2010 Time: 11:21:19 AM To change this template use File | Settings | File Templates.
    • Field Detail

      • mons

        public static String[] mons
    • Constructor Detail

      • NOWRadheader

        public NOWRadheader()
    • Method Detail

      • isValidFile

        public boolean isValidFile​(RandomAccessFile raf)
        check if this file is a nids / tdwr file
        Parameters:
        raf - input file
        Returns:
        true if valid
      • setProperty

        public void setProperty​(String name,
                                String value)
      • shortsToInt

        public static int shortsToInt​(short s1,
                                      short s2,
                                      boolean swapBytes)
        convert two short into a integer
        Parameters:
        s1 - short one
        s2 - short two
        swapBytes - if swap bytes
        Returns:
        integer
      • bytesToInt

        public static int bytesToInt​(byte[] bytes,
                                     boolean swapBytes)
        convert bytes into integer
        Parameters:
        bytes - bytes array
        swapBytes - if need to swap
        Returns:
        integer
      • bytesToInt

        public static int bytesToInt​(byte a,
                                     byte b,
                                     boolean swapBytes)
        Concatenate two bytes to a 32-bit int value. a is the high order byte in the resulting int representation, unless swapBytes is true, in which b is the high order byte.
        Parameters:
        a - high order byte
        b - low order byte
        swapBytes - byte order swap flag
        Returns:
        32-bit integer
      • convertunsignedByte2Short

        public short convertunsignedByte2Short​(byte b)
        convert unsigned byte to short
        Parameters:
        b - convert this unsigned byte
        Returns:
        unsigned short
      • convertShort2unsignedInt

        public int convertShort2unsignedInt​(short b)
        convert short to unsigned integer
        Parameters:
        b - convert this short
        Returns:
        unsigned integer
      • getDate

        public static Date getDate​(int julianDays,
                                   int msecs)
        get java date