private static void dump(String filename) throws IOException { System.out.printf("Dump %s%n", filename); RandomAccessFile raf = new RandomAccessFile(filename, "r"); NetcdfFile ncfile = new MyNetcdfFile(); // its a netcdf-3 file raf.order(RandomAccessFile.BIG_ENDIAN); N3header headerParser = new N3header(); headerParser.read(raf, ncfile, new Formatter(System.out)); raf.close(); }
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); this.ncfile = ncfile; String location = raf.getLocation(); if (!location.startsWith("http:")) { File file = new File(location); if (file.exists()) lastModified = file.lastModified(); } // its a netcdf-3 file raf.order(RandomAccessFile.BIG_ENDIAN); header = new N3header(); header.read(raf, ncfile, null); // read header here //numrecs = header.numrecs; //recsize = header.recsize; //recStart = header.recStart; _open(raf); ncfile.finish(); }
@Override public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); String location = raf.getLocation(); if (!location.startsWith("http:")) { File file = new File(location); if (file.exists()) lastModified = file.lastModified(); } // its a netcdf-3 file raf.order(RandomAccessFile.BIG_ENDIAN); header = new N3header(); header.read(raf, ncfile, null); // read header here //numrecs = header.numrecs; //recsize = header.recsize; //recStart = header.recStart; _open(raf); ncfile.finish(); }
@Override public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); this.ncfile = ncfile; String location = raf.getLocation(); if (!location.startsWith("http:")) { File file = new File(location); if (file.exists()) lastModified = file.lastModified(); } // its a netcdf-3 file raf.order(RandomAccessFile.BIG_ENDIAN); header = new N3header(); header.read(raf, ncfile, null); // read header here //numrecs = header.numrecs; //recsize = header.recsize; //recStart = header.recStart; _open(raf); ncfile.finish(); }
@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. }
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. }
@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. }