本文整理了Java中ucar.unidata.io.RandomAccessFile.getRandomAccessFile
方法的一些代码示例,展示了RandomAccessFile.getRandomAccessFile
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomAccessFile.getRandomAccessFile
方法的具体详情如下:
包路径:ucar.unidata.io.RandomAccessFile
类名称:RandomAccessFile
方法名:getRandomAccessFile
[英]Allow access to the underlying java.io.RandomAccessFile. WARNING! BROKEN ENCAPSOLATION, DO NOT USE. May change implementation in the future.
[中]允许访问底层java。伊奥。随机存取文件。警告包装破损,请勿使用。可能会在未来更改实施。
代码示例来源:origin: edu.ucar/cdm
static public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
java.io.RandomAccessFile file = raf.getRandomAccessFile();
if (file == null) return false;
boolean t = DoradeSweep.isDoradeSweep(file);
if (!t) return false;
} catch (DoradeSweep.DoradeSweepException ex) {
return false;
}
return true;
}
代码示例来源:origin: Unidata/thredds
static public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
java.io.RandomAccessFile file = raf.getRandomAccessFile();
if (file == null) return false;
boolean t = DoradeSweep.isDoradeSweep(file);
if (!t) return false;
} catch (DoradeSweep.DoradeSweepException ex) {
return false;
}
return true;
}
代码示例来源:origin: edu.ucar/netcdf
static public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
java.io.RandomAccessFile file = raf.getRandomAccessFile();
if (file == null) return false;
boolean t = DoradeSweep.isDoradeSweep(file);
if (!t) return false;
//DoradeSweep mySweep = new DoradeSweep(raf.getLocation());
} catch (DoradeSweep.DoradeSweepException ex) {
ex.printStackTrace();
return false;
// } catch (java.io.IOException ex) {
// ex.printStackTrace();
// return false;
}
return true;
}
代码示例来源:origin: Unidata/thredds
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws IOException {
super.open(raf, ncfile, cancelTask);
mySweep = new DoradeSweep(raf.getRandomAccessFile());
headerParser = new Doradeheader();
headerParser.read(mySweep, ncfile, null);
ncfile.finish();
}
代码示例来源:origin: edu.ucar/cdm
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws IOException {
super.open(raf, ncfile, cancelTask);
mySweep = new DoradeSweep(raf.getRandomAccessFile());
headerParser = new Doradeheader();
headerParser.read(mySweep, ncfile, null);
ncfile.finish();
}
代码示例来源:origin: edu.ucar/netcdf
lock = outputRaf.getRandomAccessFile().getChannel().lock(0, 1, false);
break;
代码示例来源:origin: edu.ucar/cdm
lock = outputRaf.getRandomAccessFile().getChannel().lock(0, 1, false);
break;
代码示例来源:origin: Unidata/thredds
lock = outputRaf.getRandomAccessFile().getChannel().lock(0, 1, false);
break;
代码示例来源:origin: edu.ucar/netcdf
public void create(String filename, ucar.nc2.NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) throws IOException {
this.ncfile = ncfile;
this.readonly = false;
// finish any structures
ncfile.finish();
raf = new ucar.unidata.io.RandomAccessFile(filename, "rw");
raf.order(RandomAccessFile.BIG_ENDIAN);
if (preallocateSize > 0) {
java.io.RandomAccessFile myRaf = raf.getRandomAccessFile();
myRaf.setLength(preallocateSize);
}
header = new N3header();
header.create(raf, ncfile, extra, largeFile, null);
//recsize = header.recsize; // record size
//recStart = header.recStart; // record variables start here
//fileUsed = headerParser.getMinLength(); // track what is actually used
_create(raf);
if (fill)
fillNonRecordVariables();
//else
// raf.setMinLength(recStart); // make sure file length is long enough, even if not written to.
}
代码示例来源:origin: Unidata/thredds
@Override
public void create(String filename, ucar.nc2.NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) throws IOException {
this.ncfile = ncfile;
this.readonly = false;
// finish any structures
ncfile.finish();
raf = new ucar.unidata.io.RandomAccessFile(filename, "rw");
raf.order(RandomAccessFile.BIG_ENDIAN);
if (preallocateSize > 0) {
java.io.RandomAccessFile myRaf = raf.getRandomAccessFile();
myRaf.setLength(preallocateSize);
}
header = new N3header();
header.create(raf, ncfile, extra, largeFile, null);
//recsize = header.recsize; // record size
//recStart = header.recStart; // record variables start here
//fileUsed = headerParser.getMinLength(); // track what is actually used
_create(raf);
if (fill)
fillNonRecordVariables();
//else
// raf.setMinLength(recStart); // make sure file length is long enough, even if not written to.
}
代码示例来源:origin: edu.ucar/cdm
@Override
public void create(String filename, ucar.nc2.NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) throws IOException {
this.ncfile = ncfile;
this.readonly = false;
// finish any structures
ncfile.finish();
raf = new ucar.unidata.io.RandomAccessFile(filename, "rw");
raf.order(RandomAccessFile.BIG_ENDIAN);
if (preallocateSize > 0) {
java.io.RandomAccessFile myRaf = raf.getRandomAccessFile();
myRaf.setLength(preallocateSize);
}
header = new N3header();
header.create(raf, ncfile, extra, largeFile, null);
//recsize = header.recsize; // record size
//recStart = header.recStart; // record variables start here
//fileUsed = headerParser.getMinLength(); // track what is actually used
_create(raf);
if (fill)
fillNonRecordVariables();
//else
// raf.setMinLength(recStart); // make sure file length is long enough, even if not written to.
}
代码示例来源:origin: edu.ucar/netcdf
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) throws IOException {
super.open(raf, ncfile, cancelTask);
try {
mySweep = new DoradeSweep(raf.getRandomAccessFile());
} catch (DoradeSweep.DoradeSweepException ex) {
ex.printStackTrace();
} catch (java.io.IOException ex) {
ex.printStackTrace();
}
if (mySweep.getScanMode(0) != ScanMode.MODE_SUR) {
// System.err.println("ScanMode is : " + mySweep.getScanMode(0).getName());
//System.exit(1);
}
try {
headerParser = new Doradeheader();
headerParser.read(mySweep, ncfile, null);
} catch (DoradeSweep.DoradeSweepException e) {
e.printStackTrace();
}
ncfile.finish();
}
内容来源于网络,如有侵权,请联系作者删除!