boolean rewriteHeader(boolean largeFile, Formatter fout) throws IOException { int want = sizeHeader(largeFile); if (want > dataStart) return false; writeHeader(0, largeFile, true, fout); return true; }
NetcdfFileStream(DataOutputStream stream) { super(); this.stream = stream; swriter = new N3outputStreamWriter(this); }
@Override public int appendStructureData(Structure s, StructureData sdata) throws IOException, InvalidRangeException { int recnum = header.numrecs; setNumrecs(recnum + 1); writeRecordData(s, recnum, sdata); return recnum; }
/** * Set properties. Currently recognized: * "syncExtendOnly", "true" or "false" (default). if true, can only extend file on a sync. * * @param name name of property * @param value value of property */ static public void setProperty(String name, String value) { N3iosp.setProperty(name, value); }
void writeRecordData(List<Variable> varList) throws IOException { swriter.writeRecordData(stream, varList); } }
@Override public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) throws IOException { return N3header.isValidFile(raf); }
@Override public void openForWriting(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { open(raf, ncfile, cancelTask); }
@Override public boolean rewriteHeader(boolean largeFile) throws IOException { return header.rewriteHeader(largeFile, null); }
public static void main(String[] args) throws IOException { dump("D:/work/csiro/testWrite.nc"); /* dump("D:/work/csiro/russ/sixCells.nc"); System.out.printf("--------------------------%n"); dump("D:/work/csiro/russ/sixCellsc.nc"); */ }
static public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) throws IOException { switch (checkFileType(raf)) { case NC_FORMAT_NETCDF3: case NC_FORMAT_64BIT_OFFSET: return true; default: break; } return false; }
@Override public int appendStructureData(Structure s, StructureData sdata) throws IOException, InvalidRangeException { int recnum = header.numrecs; setNumrecs(recnum + 1); writeRecordData(s, recnum, sdata); return recnum; }
NetcdfFileStream(DataOutputStream stream) { super(); this.stream = stream; swriter = new N3outputStreamWriter(this); }
/** * Set properties. Currently recognized: * "syncExtendOnly", "true" or "false" (default). if true, can only extend file on a sync. * * @param name name of property * @param value value of property */ static public void setProperty(String name, String value) { N3iosp.setProperty(name, value); }
void writeRecordData(List<Variable> varList) throws IOException { swriter.writeRecordData(stream, varList); } }
NetcdfFileStream(DataOutputStream stream) { super(); this.stream = stream; swriter = new N3outputStreamWriter(this); }
/** * Set properties. Currently recognized: * "syncExtendOnly", "true" or "false" (default). if true, can only extend file on a sync. * * @param name name of property * @param value value of property */ static public void setProperty(String name, String value) { N3iosp.setProperty(name, value); }
void writeRecordData(List<Variable> varList) throws IOException { swriter.writeRecordData(stream, varList); } }
NetcdfFileStream(DataOutputStream stream) { super(); this.stream = stream; swriter = new N3outputStreamWriter(this); }