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

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

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

RandomAccessFile.isAtEndOfFile介绍

[英]Return true if file pointer is at end of file.
[中]如果文件指针位于文件末尾,则返回true。

代码示例

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

public static void main2(String[] args) throws IOException {
 String filename = (args.length > 0 && args[0] != null) ? args[0] : "Q:/cdmUnitTest/formats/grib2/LMPEF_CLM_050518_1200.grb";
 System.out.printf("Scan %s%n", filename);
 try (RandomAccessFile raf = new RandomAccessFile(filename, "r")) {
  raf.seek(0);
  while (!raf.isAtEndOfFile()) {
   boolean found = raf.searchForward(matcher, -1);
   if (found) {
    raf.skipBytes(7); // will be positioned on byte 0 of indicator section
    int edition = raf.read(); // read at byte 8
    System.out.printf(" GRIB edition %d found at pos %d%n", edition, raf.getFilePointer());
    break;
   }
  }
 } catch (IOException e) {
  e.printStackTrace();
 }
}

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

int rayNumber = 0;
while (!raf.isAtEndOfFile()) {
  byte [] b4 = new byte[4];
  raf.read(b4, 0, 4);

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

while (!raf.isAtEndOfFile()) {
 byte[] b4 = new byte[4];
 int bytesRead = raf.read(b4);

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

while (!raf.isAtEndOfFile()) {
 byte[] b4 = new byte[4];
 int bytesRead = raf.read(b4);

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

while (!raf.isAtEndOfFile()) {
 pos = raf.getFilePointer();
 byte[] b = new byte[4];

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

ncfile.finish();
while (!raf.isAtEndOfFile()) {
 pos = raf.getFilePointer();
 byte[] b = new byte[4];

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

ncfile.finish();
while (!raf.isAtEndOfFile()) {
 pos = raf.getFilePointer();
 byte[] b = new byte[4];

相关文章