cdm/src/main/java/ucar/nc2/iosp/dmsp/DMSPHeader.java
private void handleFileInformation()
          throws IOException
  {
    fileIdAtt = new Attribute( this.fileIdAttName, headerInfo.get(HeaderInfoTitle.FILE_ID.toString() ) );
    datasetIdAtt = new Attribute( this.datasetIdAttName, headerInfo.get(HeaderInfoTitle.DATA_SET_ID.toString() ) );
    recordSizeInBytes = Integer.parseInt( headerInfo.get( HeaderInfoTitle.RECORD_BYTES.toString() ) );
    numRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_RECORDS.toString() ) );
    numHeaderRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_HEADER_RECORDS.toString() ) );
    numDataRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_DATA_RECORDS.toString() ) );
    numDataRecordsDim = new Dimension( this.numDataRecordsDimName, numDataRecords, true, true, false);
    numArtificialDataRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_ARTIFICIAL_DATA_RECORDS.toString() ) );
    this.headerSizeInBytes = this.numHeaderRecords * this.recordSizeInBytes;
    if ( numRecords * ((long) this.recordSizeInBytes) != this.actualSize )
    {
      throw new IOException( "Invalid DMSP file: the number of records <" + this.numRecords + "> times the record size <" + this.recordSizeInBytes + "> does not equal the size of the file <" + this.actualSize + ">." );
    }
  }
private void handleFileInformation()
          throws IOException
  {
    fileIdAtt = new Attribute( this.fileIdAttName, headerInfo.get(HeaderInfoTitle.FILE_ID.toString() ) );
    datasetIdAtt = new Attribute( this.datasetIdAttName, headerInfo.get(HeaderInfoTitle.DATA_SET_ID.toString() ) );
    recordSizeInBytes = Integer.parseInt( headerInfo.get( HeaderInfoTitle.RECORD_BYTES.toString() ) );
    numRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_RECORDS.toString() ) );
    numHeaderRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_HEADER_RECORDS.toString() ) );
    numDataRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_DATA_RECORDS.toString() ) );
    numDataRecordsDim = new Dimension( this.numDataRecordsDimName, numDataRecords, true, true, false);
    numArtificialDataRecords = Integer.parseInt( headerInfo.get( HeaderInfoTitle.NUM_ARTIFICIAL_DATA_RECORDS.toString() ) );
    this.headerSizeInBytes = this.numHeaderRecords * this.recordSizeInBytes;
    if ( numRecords * ((long) this.recordSizeInBytes) != this.actualSize )
    {
      throw new IOException( "Invalid DMSP file: the number of records <" + this.numRecords + "> times the record size <" + this.recordSizeInBytes + "> does not equal the size of the file <" + this.actualSize + ">." );
    }
  }
private void handleFileInformation ( ) throws IOException { fileIdAtt = new Attribute ( this . fileIdAttName , headerInfo . get ( HeaderInfoTitle . FILE_ID . toString ( ) ) ) ; datasetIdAtt = new Attribute ( this . datasetIdAttName , headerInfo . get ( HeaderInfoTitle . DATA_SET_ID . toString ( ) ) ) ; recordSizeInBytes = Integer . parseInt ( headerInfo . get ( HeaderInfoTitle . RECORD_BYTES . toString ( ) ) ) ; numRecords = Integer . parseInt ( headerInfo . get ( HeaderInfoTitle . NUM_RECORDS . toString ( ) ) ) ; numHeaderRecords = Integer . parseInt ( headerInfo . get ( HeaderInfoTitle . NUM_HEADER_RECORDS . toString ( ) ) ) ; numDataRecords = Integer . parseInt ( headerInfo . get ( HeaderInfoTitle . NUM_DATA_RECORDS . toString ( ) ) ) ; numDataRecordsDim = new Dimension ( this . numDataRecordsDimName , numDataRecords , true , true , false ) ; numArtificialDataRecords = Integer . parseInt ( headerInfo . get ( HeaderInfoTitle . NUM_ARTIFICIAL_DATA_RECORDS . toString ( ) ) ) ; this . headerSizeInBytes = this . numHeaderRecords * this . recordSizeInBytes ; if ( numRecords * ( ( long ) this . recordSizeInBytes ) != this . actualSize ) { throw new IOException ( "Invalid DMSP file: the number of records <" + this . numRecords + "> times the record size <" + this . recordSizeInBytes + "> does not equal the size of the file <" + this . actualSize + ">." ) ; } }
Parse the file header information about the file (e.g., file ID, dataset ID,
record size, number of records) and create netCDF attributes and dimensions
where appropriate.

@throws IOException if any problems reading the file (or validating the file).
Parse the file header information about the file ( e . g . file ID dataset ID record size number of records ) and create netCDF attributes and dimensions where appropriate .