本文整理了Java中ucar.unidata.io.RandomAccessFile.isAtEndOfFile
方法的一些代码示例,展示了RandomAccessFile.isAtEndOfFile
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.isAtEndOfFile
方法的具体详情如下:
包路径:ucar.unidata.io.RandomAccessFile
类名称: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];
内容来源于网络,如有侵权,请联系作者删除!