ucar.unidata.io.RandomAccessFile.setMinLength()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中ucar.unidata.io.RandomAccessFile.setMinLength方法的一些代码示例,展示了RandomAccessFile.setMinLength的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.setMinLength方法的具体详情如下:
包路径:ucar.unidata.io.RandomAccessFile
类名称:RandomAccessFile
方法名:setMinLength

RandomAccessFile.setMinLength介绍

[英]Make sure file is at least this long when its closed. needed when not using fill mode, and not all data is written.
[中]确保文件关闭时至少有这么长。不使用填充模式时需要,并且并非所有数据都被写入。

代码示例

代码示例来源:origin: edu.ucar/cdm

@Override
public void close() throws java.io.IOException {
 if (raf != null) {
  long size = header.calcFileSize();
  raf.setMinLength( size);
  raf.close();
 }
 raf = null;
}

代码示例来源:origin: Unidata/thredds

@Override
public void close() throws java.io.IOException {
 if (raf != null) {
  long size = header.calcFileSize();
  raf.setMinLength(size);
  raf.close();
 }
 raf = null;
}

代码示例来源:origin: edu.ucar/netcdf

public void close() throws java.io.IOException {
 if (raf != null) {
  long size = header.calcFileSize();
  raf.setMinLength( size);
  raf.close();
 }
 raf = null;
}

代码示例来源:origin: Unidata/thredds

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());
}

代码示例来源:origin: edu.ucar/cdm

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());
}

代码示例来源:origin: edu.ucar/netcdf

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());
}

相关文章