visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java
protected void readParts() throws IOException {
    if (dmLabel == null) {
      return;
    }
    int iread = dmLabel.kppart;
    int numParts = dmLabel.kprt;
    DMPart[] partArray = new DMPart[numParts];
    // read the part names
    for (int i = 0; i < numParts; i++) {
      partArray[i] = new DMPart();
      partArray[i].kprtnm = DM_RSTR(iread++);
    }
    // read the part header lengths
    for (int i = 0; i < numParts; i++) {
      partArray[i].klnhdr = DM_RINT(iread++);
    }
    // read the part types
    for (int i = 0; i < numParts; i++) {
      partArray[i].ktyprt = DM_RINT(iread++);
    }
    // get number of parameters/per part.
    for (int i = 0; i < numParts; i++) {
      partArray[i].kparms = DM_RINT(iread++);
    }
    // read parameter names
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List<DMParam> parms = new ArrayList<>(numParms);
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = new DMParam();
        parms.add(dmp);
        dmp.kprmnm = DM_RSTR(iread++);
      }
      partArray[i].params = parms;
    }
    // read the scale
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.kscale = DM_RINT(iread++);
      }
    }
    // read the offset
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.koffst = DM_RINT(iread++);
      }
    }
    // read the nbits
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.kbits = DM_RINT(iread++);
      }
    }
    parts = new ArrayList<>(numParts);
    parts.addAll(Arrays.asList(partArray).subList(0, numParts));
    for (DMPart part : parts) {
      if (part.ktyprt == MDRPCK) {
        part.packInfo = new PackingInfo(part);
      }
    }
  }
protected void readParts() throws IOException {
    if (dmLabel == null) {
      return;
    }
    int iread = dmLabel.kppart;
    int numParts = dmLabel.kprt;
    DMPart[] partArray = new DMPart[numParts];
    // read the part names
    for (int i = 0; i < numParts; i++) {
      partArray[i] = new DMPart();
      partArray[i].kprtnm = DM_RSTR(iread++);
    }
    // read the part header lengths
    for (int i = 0; i < numParts; i++) {
      partArray[i].klnhdr = DM_RINT(iread++);
    }
    // read the part types
    for (int i = 0; i < numParts; i++) {
      partArray[i].ktyprt = DM_RINT(iread++);
    }
    // get number of parameters/per part.
    for (int i = 0; i < numParts; i++) {
      partArray[i].kparms = DM_RINT(iread++);
    }
    // read parameter names
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List<DMParam> parms = new ArrayList<>(numParms);
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = new DMParam();
        parms.add(dmp);
        dmp.kprmnm = DM_RSTR(iread++);
      }
      partArray[i].params = parms;
    }
    // read the scale
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.kscale = DM_RINT(iread++);
      }
    }
    // read the offset
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.koffst = DM_RINT(iread++);
      }
    }
    // read the nbits
    for (int i = 0; i < numParts; i++) {
      int numParms = partArray[i].kparms;
      List parms = partArray[i].params;
      for (int j = 0; j < numParms; j++) {
        DMParam dmp = (DMParam) parms.get(j);
        dmp.kbits = DM_RINT(iread++);
      }
    }
    parts = new ArrayList<>(numParts);
    parts.addAll(Arrays.asList(partArray).subList(0, numParts));
    for (DMPart part : parts) {
      if (part.ktyprt == MDRPCK) {
        part.packInfo = new PackingInfo(part);
      }
    }
  }
Read the parts (DM_RPRT)

@throws IOException problem reading file