public class FileWriter2 extends Object
Use a NetcdfFileWriter object for a lower level API.
| Modifier and Type | Class and Description |
|---|---|
static class |
FileWriter2.ChunkingIndex
An index that computes chunk shapes.
|
static class |
FileWriter2.FileWriterProgressEvent
Track the progress of file writing.
|
static interface |
FileWriter2.FileWriterProgressListener |
| Constructor and Description |
|---|
FileWriter2(NetcdfFile fileIn,
String fileOutName,
NetcdfFileWriter.Version version,
Nc4Chunking chunker)
Use this constructor to copy entire file.
|
FileWriter2(NetcdfFileWriter fileWriter)
Use this constructor to copy specific variables to new file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addProgressListener(FileWriter2.FileWriterProgressListener listener) |
Variable |
addVariable(Variable oldVar)
Specify which variable will get written
|
double |
copyVarData(List<Variable> varlist,
Structure recordVar)
Write data from varList into new file.
|
NetcdfFileWriter |
getNetcdfFileWriter() |
static void |
main(String[] arg)
Main program.
|
static void |
setDebugFlags(DebugFlags debugFlags)
Set debugging flags
|
NetcdfFile |
write() |
public FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker) throws IOException
fileIn - copy this filefileOutName - to this output fileversion - output file versionIOException - on read/write errorpublic FileWriter2(NetcdfFileWriter fileWriter) throws IOException
fileWriter - this encapsolates new file.IOException - on read/write errorpublic static void setDebugFlags(DebugFlags debugFlags)
debugFlags - debug flagspublic void addProgressListener(FileWriter2.FileWriterProgressListener listener)
public NetcdfFileWriter getNetcdfFileWriter()
public Variable addVariable(Variable oldVar)
oldVar - add this variable, and all parent groupspublic NetcdfFile write() throws IOException
IOExceptionpublic double copyVarData(List<Variable> varlist, Structure recordVar) throws IOException
varlist - list of variables 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-2013 UCAR/Unidata. All Rights Reserved.