public class FileWriter2 extends Object
Use the static methods writeToFile() to copy an entire file. Create a FileWriter object to control exactly what gets written to the file.
NetcdfFile| Modifier and Type | Class and Description |
|---|---|
static class |
FileWriter2.ChunkingIndex
An index that computes chunk shapes.
|
static class |
FileWriter2.FileWriterProgressEvent |
static interface |
FileWriter2.FileWriterProgressListener |
| Constructor and Description |
|---|
FileWriter2(NetcdfFile fileIn,
String fileOutName,
NetcdfFileWriter.NetcdfVersion version) |
FileWriter2(NetcdfFile fileIn,
String fileOutName,
NetcdfFileWriter.NetcdfVersion version,
boolean fill,
boolean isLargeFile,
int extraHeaderBytes,
List<FileWriter2.FileWriterProgressListener> progressListeners)
Copy a NetcdfFile to a physical file, using Netcdf-3 or 4 file format.
|
| Modifier and Type | Method and Description |
|---|---|
double |
copyVarData(List<Variable> varlist,
Structure recordVar)
Write data from varList into new file.
|
static void |
main(String[] arg)
Main program.
|
static void |
setDebugFlags(DebugFlags debugFlags)
Set debugging flags
|
NetcdfFile |
write() |
public FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.NetcdfVersion version) throws IOException
IOExceptionpublic FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.NetcdfVersion version, boolean fill, boolean isLargeFile, int extraHeaderBytes, List<FileWriter2.FileWriterProgressListener> progressListeners) throws IOException
fileIn - write from this NetcdfFilefileOutName - write to this local filefill - use fill modeisLargeFile - if true, make large file format (> 2Gb offsets)progressListeners - List of progress listeners, use null or empty list if there are none.IOException - on read or write errorpublic static void setDebugFlags(DebugFlags debugFlags)
debugFlags - debug flagspublic NetcdfFile write() throws IOException
IOExceptionpublic double copyVarData(List<Variable> varlist, Structure recordVar) throws IOException
varlist - list of varibles from the original file, with data in themrecordVar - the record variable from the original file, or null means dont use record variablesIOException - if I/O errorpublic static void main(String[] arg) throws IOException
ucar.nc2.FileWriter -in fileIn -out fileOut.
where:
arg - -in fileIn -out fileOut [-netcdf4]IOException - on read or write errorCopyright © 1999-2012 UCAR/Unidata. All Rights Reserved.