grib/src/main/java/ucar/nc2/grib/grib1/Grib1Record.java
public GribData.Info getBinaryDataInfo(RandomAccessFile raf) throws IOException {
    GribData.Info info = dataSection.getBinaryDataInfo(raf);
    info.decimalScaleFactor = pdss.getDecimalScale();
    info.bitmapLength = (bitmap == null) ? 0 : bitmap.getLength(raf);
    info.nPoints = getGDS().getNpts();
    info.msgLength = is.getMessageLength();

    if (bitmap == null) {
      info.ndataPoints = info.nPoints;
    } else {
      byte[] bm = bitmap.getBitmap(raf);
      if (bm == null) {
        info.ndataPoints = info.nPoints;
      } else { // have to count the bits to see how many data values are stored
        info.ndataPoints = GribNumbers.countBits(bm);
      }
    }

    return info;
  }
public GribData.Info getBinaryDataInfo(RandomAccessFile raf) throws IOException {
    GribData.Info info = dataSection.getBinaryDataInfo(raf);
    info.decimalScaleFactor = pdss.getDecimalScale();
    info.bitmapLength = (bitmap == null) ? 0 : bitmap.getLength(raf);
    info.nPoints = getGDS().getNpts();
    info.msgLength = is.getMessageLength();

    if (bitmap == null) {
      info.ndataPoints = info.nPoints;
    } else {
      byte[] bm = bitmap.getBitmap(raf);
      if (bm == null) {
        info.ndataPoints = info.nPoints;
      } else { // have to count the bits to see how many data values are stored
        info.ndataPoints = GribNumbers.countBits(bm);
      }
    }

    return info;
  }
/*
Read data array: use when you want to be independent of the GribRecord

@param raf          from this RandomAccessFile
@param bmPos        bitmap.start
@param decimalScale pds.decimalScale
@param scanMode     gds.scanMode
@param nx           gds.nx
@param ny           gds.ny
@return data as float[] array
@throws IOException on read error

public static float[] readData(RandomAccessFile raf, long bmPos, int decimalScale, int scanMode, int nx, int ny) throws IOException {
raf.seek(bmPos);
Grib1SectionBitMap bms = new Grib1SectionBitMap(raf);
Grib1DataReader reader = new Grib1DataReader(decimalScale, scanMode, nx, ny, raf.getFilePointer());

boolean[] bitmap = bms.getBitmap(raf);

return reader.getData(raf, bitmap);
}