cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java
int read_msghead( ByteBuffer buf, int offset)
    {

        byte[] b2 = new byte[2];
        byte[] b4 = new byte[4];

        buf.position(0);
        buf.get(b2, 0, 2);
        mcode = (short) getInt(b2, 2);
        buf.get(b2, 0, 2);
        mdate = (short) getInt(b2, 2);
        buf.get(b4, 0, 4);
        mtime = getInt(b4, 4);
        buf.get(b4, 0, 4);
        //out.println( "product date is " + dstring);
        mlength = getInt(b4, 4);
        buf.get(b2, 0, 2);
        msource = (short) getInt(b2, 2);
        if(stationId == null || stationName == null) {
          try {
              NexradStationDB.init(); // make sure database is initialized
              NexradStationDB.Station station = NexradStationDB.getByIdNumber("000"+Short.toString(msource));
              if (station != null) {
                stationId = station.id;
                stationName = station.name;
              }
            } catch (IOException ioe) {
              log.error("NexradStationDB.init "+raf.getLocation(), ioe);
            }
        }
        buf.get(b2, 0, 2);
        mdestId = (short) getInt(b2, 2);
        buf.get(b2, 0, 2);
        mNumOfBlock = (short) getInt(b2, 2);

        return 1;

    }
int read_msghead( ByteBuffer buf, int offset)
    {

        byte[] b2 = new byte[2];
        byte[] b4 = new byte[4];

        buf.position(0);
        buf.get(b2, 0, 2);
        mcode = (short) getInt(b2, 2);
        buf.get(b2, 0, 2);
        mdate = (short) getInt(b2, 2);
        buf.get(b4, 0, 4);
        mtime = getInt(b4, 4);
        buf.get(b4, 0, 4);
        //out.println( "product date is " + dstring);
        mlength = getInt(b4, 4);
        buf.get(b2, 0, 2);
        msource = (short) getInt(b2, 2);
        if(stationId == null || stationName == null) {
          try {
              NexradStationDB.init(); // make sure database is initialized
              NexradStationDB.Station station = NexradStationDB.getByIdNumber("000"+Short.toString(msource));
              if (station != null) {
                stationId = station.id;
                stationName = station.name;
              }
            } catch (IOException ioe) {
              log.error("NexradStationDB.init "+raf.getLocation(), ioe);
            }
        }
        buf.get(b2, 0, 2);
        mdestId = (short) getInt(b2, 2);
        buf.get(b2, 0, 2);
        mNumOfBlock = (short) getInt(b2, 2);

        return 1;

    }
int read_msghead ( ByteBuffer buf , int offset ) { byte [ ] b2 = new byte [ 2 ] ; byte [ ] b4 = new byte [ 4 ] ; buf . position ( 0 ) ; buf . get ( b2 , 0 , 2 ) ; mcode = ( short ) getInt ( b2 , 2 ) ; buf . get ( b2 , 0 , 2 ) ; mdate = ( short ) getInt ( b2 , 2 ) ; buf . get ( b4 , 0 , 4 ) ; mtime = getInt ( b4 , 4 ) ; buf . get ( b4 , 0 , 4 ) ; //out.println( "product date is " + dstring);
 mlength = getInt ( b4 , 4 ) ; buf . get ( b2 , 0 , 2 ) ; msource = ( short ) getInt ( b2 , 2 ) ; if ( stationId == null || stationName == null ) { try { NexradStationDB . init ( ) ; // make sure database is initialized
 NexradStationDB . Station station = NexradStationDB . getByIdNumber ( "000" + Short . toString ( msource ) ) ; if ( station != null ) { stationId = station . id ; stationName = station . name ; } } catch ( IOException ioe ) { log . error ( "NexradStationDB.init " + raf . getLocation ( ) , ioe ) ; } } buf . get ( b2 , 0 , 2 ) ; mdestId = ( short ) getInt ( b2 , 2 ) ; buf . get ( b2 , 0 , 2 ) ; mNumOfBlock = ( short ) getInt ( b2 , 2 ) ; return 1 ; }
/*
* Name:       read_msghead
*
* Purpose:    Read message header from NEXRAD Level III product
*
*
/ * * Name : read_msghead * * Purpose : Read message header from NEXRAD Level III product * *