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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章