protected void setNumrecs(int n) throws IOException, InvalidRangeException { if (n <= header.numrecs) return; int startRec = header.numrecs; if (debugSize) System.out.println("extend records to = " + n); //fileUsed = recStart + recsize * n; header.setNumrecs(n); //this.numrecs = n; // need to let unlimited dimension know of new shape for (Dimension dim : ncfile.getDimensions()) { if (dim.isUnlimited()) dim.setLength(n); } // need to let all unlimited variables know of new shape for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) { v.resetShape(); v.setCachedData(null, false); } } // extend file, handle filling if (fill) fillRecordVariables(startRec, n); else raf.setMinLength( header.calcFileSize()); }
protected void setNumrecs(int n) throws IOException, InvalidRangeException { if (n <= header.numrecs) return; int startRec = header.numrecs; if (debugSize) System.out.println("extend records to = " + n); //fileUsed = recStart + recsize * n; header.setNumrecs(n); //this.numrecs = n; // need to let unlimited dimension know of new shape for (Dimension dim : ncfile.getDimensions()) { if (dim.isUnlimited()) dim.setLength(n); } // need to let all unlimited variables know of new shape for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) { v.resetShape(); v.setCachedData(null, false); } } // extend file, handle filling if (fill) fillRecordVariables(startRec, n); else raf.setMinLength( header.calcFileSize()); }
protected void setNumrecs(int n) throws IOException, InvalidRangeException { if (n <= header.numrecs) return; int startRec = header.numrecs; if (debugSize) System.out.println("extend records to = " + n); //fileUsed = recStart + recsize * n; header.setNumrecs(n); //this.numrecs = n; // need to let unlimited dimension know of new shape for (Dimension dim : ncfile.getDimensions()) { if (dim.isUnlimited()) dim.setLength(n); } // need to let all unlimited variables know of new shape for (Variable v : ncfile.getVariables()) { if (v.isUnlimited()) { v.resetShape(); v.setCachedData(null, false); } } // extend file, handle filling if (fill) fillRecordVariables(startRec, n); else raf.setMinLength( header.calcFileSize()); }