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

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

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

RandomAccessFile.getLocation介绍

[英]Get the file location, or name.
[中]获取文件位置或名称。

代码示例

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

/**
 * public by accident, do not use
 *
 * @param indexRaf the open raf of the index file
 */
void setIndexRaf(RandomAccessFile indexRaf) {
 this.indexRaf = indexRaf;
 if (indexRaf != null) {
  this.indexFilename = indexRaf.getLocation();
 }
}

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

@Override
public void open( RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask ) throws IOException {
 this.raf = raf;
 this.location = (raf != null) ? raf.getLocation() : null;
 this.ncfile = ncfile;
}

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

public GridIndexToNC(ucar.unidata.io.RandomAccessFile raf) {
 this.indexFilename = raf.getLocation();
 this.raf = raf;
}

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

@Override
public long getLastModified() {
 File file = new File(getLocation());
 return file.lastModified();
}

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

@Override
public long getLastModified() {
 File file = new File(getLocation());
 return file.lastModified();
}

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

@Override
public long getLastModified() {
 File file = new File(getLocation());
 return file.lastModified();
}

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

public File getIndexParentFile() {
 if (indexRaf == null) return null;
 Path index = Paths.get(indexRaf.getLocation());
 Path parent = index.getParent();
 return parent.toFile();
}

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

public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) throws IOException {
 //  second check the file name
 if (!((raf.getLocation().endsWith(".AWX") || raf.getLocation().endsWith(".awx")))) {
  return false;
 }
 // more serious checking
 return this.readPIB(raf);// not FY Satellite AWX product file
}

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

public boolean isValidFile(RandomAccessFile raf) throws IOException {
 String location = raf.getLocation();
 if (!location.endsWith(".DEM")) return false;
 int pos = location.lastIndexOf('.');
 String stub = location.substring(0, pos);
 File hdrFile = new File(stub + ".HDR");
 return hdrFile.exists();
}

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

public boolean isValidFile(RandomAccessFile raf) throws IOException {
 String location = raf.getLocation();
 if (!location.endsWith(".DEM")) return false;
 int pos = location.lastIndexOf('.');
 String stub = location.substring(0, pos);
 File hdrFile = new File(stub + ".HDR");
 return hdrFile.exists();
}

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

public boolean isValidFile(RandomAccessFile raf) throws IOException {
 String location = raf.getLocation();
 if (!location.endsWith(".DEM")) return false;
 int pos = location.lastIndexOf('.');
 String stub = location.substring(0, pos);
 File hdrFile = new File(stub + ".HDR");
 return hdrFile.exists();
}

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

@Override
public boolean syncExtend() throws IOException {
 boolean result = header.synchNumrecs();
 if (result && log.isDebugEnabled())
  log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
 return result;
}

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

EmbeddedTable(Message m, RandomAccessFile raf) {
 this.raf = raf;
 this.ids = m.ids;
 b = new TableB("embed", raf.getLocation());
 d = new TableD("embed", raf.getLocation());
}

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

@Override
public boolean syncExtend() throws IOException {
 boolean result = header.synchNumrecs();
 if (result && log.isDebugEnabled())
  log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
 return result;
}

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

private BufrConfig(RandomAccessFile raf) throws IOException {
 this.filename =  raf.getLocation();
 try {
  scanBufrFile(raf);
 } catch (Exception e) {
  e.printStackTrace();
  throw new RuntimeException(e.getMessage());
 }
}

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

@Override
public boolean syncExtend() throws IOException {
 boolean result = header.synchNumrecs();
 if (result && log.isDebugEnabled())
  log.debug(" N3iosp syncExtend " + raf.getLocation() + " numrecs =" + header.numrecs);
 return result;
}

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

@Override
public String getDetailInfo() {
 if (raf == null) return "";
 try {
  Formatter fout = new Formatter();
  double size = raf.length() / (1000.0 * 1000.0);
  fout.format(" raf = %s%n", raf.getLocation());
  fout.format(" size= %d (%s Mb)%n%n", raf.length(), Format.dfrac(size, 3));
  return fout.toString();
 } catch (IOException e) {
  return e.getMessage();
 }
}

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

public static void main(String[] args) throws IOException {
 int count = 0;
 RandomAccessFile raf = new RandomAccessFile("Q:/cdmUnitTest/formats/grib2/LMPEF_CLM_050518_1200.grb", "r");
 System.out.printf("Read %s%n", raf.getLocation());
 Grib2RecordScanner scan = new Grib2RecordScanner(raf);
 while (scan.hasNext()) {
  scan.next();
  count++;
 }
 raf.close();
 System.out.printf("count=%d%n",count);
}

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

public float[] getData(RandomAccessFile raf, byte[] bitmap) throws IOException {
 GribData.Info info = Grib1SectionBinaryData.getBinaryDataInfo(raf, startPos);
 boolean isGridPointData = !GribNumbers.testBitIsSet(info.flag, 1);
 boolean isSimplePacking = !GribNumbers.testBitIsSet(info.flag, 2);
 if (isGridPointData && isSimplePacking) {
  return readSimplePacking(raf, bitmap, info);
 }
 if (isGridPointData && !isSimplePacking) {
  return readExtendedComplexPacking(raf, bitmap, info);
 }
 logger.warn("Grib1BinaryDataSection: (octet 4, 1st half) not grid point data and simple packing for {}", raf.getLocation());
 throw new IllegalStateException("Grib1BinaryDataSection: (octet 4, 1st half) not grid point data and simple packing ");
}

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

private BufrConfig(RandomAccessFile raf, Message m) throws IOException {
 this.filename =  raf.getLocation();
 this.messHash = m.hashCode();
 this.rootConverter = new FieldConverter(m.ids.getCenterId(), m.getRootDataDescriptor());
 standardFields = StandardFields.extract(m);
}

相关文章