cdm/src/main/java/ucar/nc2/iosp/nexrad2/Level2Record.java
public void readData(RandomAccessFile raf, int datatype, Range gateRange, IndexIterator ii) throws IOException {
    long offset = message_offset;
    offset += MESSAGE_HEADER_SIZE; // offset is from "start of digital radar data message header"
    offset += getDataOffset(datatype);
    raf.seek(offset);
    if (logger.isDebugEnabled()) {
      logger.debug("  read recno " + recno + " at offset " + offset + " count= " + getGateCount(datatype));
      logger.debug("   offset: reflect= " + reflect_offset + " velocity= " + velocity_offset + " spWidth= " + spectWidth_offset);
    }

    int dataCount = getGateCount(datatype);
    if (datatype == DIFF_PHASE) {
      short[] data = new short[dataCount];
      raf.readShort(data, 0, dataCount);

      for (int gateIdx : gateRange) {
        if (gateIdx >= dataCount)
          ii.setShortNext(MISSING_DATA);
        else
          ii.setShortNext(data[gateIdx]);
      }
    } else {

      byte[] data = new byte[dataCount];
      raf.readFully(data);
      //short [] ds = convertunsignedByte2Short(data);
      for (int gateIdx : gateRange) {
        if (gateIdx >= dataCount)
          ii.setByteNext(MISSING_DATA);
        else
          ii.setByteNext(data[gateIdx]);
      }

    }
  }
public void readData(RandomAccessFile raf, int datatype, Range gateRange, IndexIterator ii) throws IOException {
    long offset = message_offset;
    offset += MESSAGE_HEADER_SIZE; // offset is from "start of digital radar data message header"
    offset += getDataOffset(datatype);
    raf.seek(offset);
    if (logger.isDebugEnabled()) {
      logger.debug("  read recno " + recno + " at offset " + offset + " count= " + getGateCount(datatype));
      logger.debug("   offset: reflect= " + reflect_offset + " velocity= " + velocity_offset + " spWidth= " + spectWidth_offset);
    }

    int dataCount = getGateCount(datatype);
    if (datatype == DIFF_PHASE) {
      short[] data = new short[dataCount];
      raf.readShort(data, 0, dataCount);

      for (int gateIdx : gateRange) {
        if (gateIdx >= dataCount)
          ii.setShortNext(MISSING_DATA);
        else
          ii.setShortNext(data[gateIdx]);
      }
    } else {

      byte[] data = new byte[dataCount];
      raf.readFully(data);
      //short [] ds = convertunsignedByte2Short(data);
      for (int gateIdx : gateRange) {
        if (gateIdx >= dataCount)
          ii.setByteNext(MISSING_DATA);
        else
          ii.setByteNext(data[gateIdx]);
      }

    }
  }
public void readData ( RandomAccessFile raf , int datatype , Range gateRange , IndexIterator ii ) throws IOException { long offset = message_offset ; offset += MESSAGE_HEADER_SIZE ; // offset is from "start of digital radar data message header" offset += getDataOffset ( datatype ) ; raf . seek ( offset ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "  read recno " + recno + " at offset " + offset + " count= " + getGateCount ( datatype ) ) ; logger . debug ( "   offset: reflect= " + reflect_offset + " velocity= " + velocity_offset + " spWidth= " + spectWidth_offset ) ; } int dataCount = getGateCount ( datatype ) ; if ( datatype == DIFF_PHASE ) { short [ ] data = new short [ dataCount ] ; raf . readShort ( data , 0 , dataCount ) ; for ( int gateIdx : gateRange ) { if ( gateIdx >= dataCount ) ii . setShortNext ( MISSING_DATA ) ; else ii . setShortNext ( data [ gateIdx ] ) ; } } else { byte [ ] data = new byte [ dataCount ] ; raf . readFully ( data ) ; //short [] ds = convertunsignedByte2Short(data); for ( int gateIdx : gateRange ) { if ( gateIdx >= dataCount ) ii . setByteNext ( MISSING_DATA ) ; else ii . setByteNext ( data [ gateIdx ] ) ; } } }
Read data from this record.

@param raf       read from this file
@param datatype  which type of data : REFLECTIVITY, VELOCITY_HI, VELOCITY_LO, SPECTRUM_WIDTH
@param gateRange handles the possible subset of data to return
@param ii        put the data here
@throws IOException on read error
Read data from this record .