public class FileWriter
extends java.lang.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 |
FileWriter.ChunkingIndex
Deprecated.
use FileWriter2.ChunkingIndex
|
static class |
FileWriter.FileWriterProgressEvent
Deprecated.
use FileWriter2.FileWriterProgressEvent
|
static interface |
FileWriter.FileWriterProgressListener
Deprecated.
|
Constructor and Description |
---|
FileWriter(java.lang.String fileOutName,
boolean fill)
Deprecated.
For writing parts of a NetcdfFile to a new Netcdf-3 local file.
|
FileWriter(java.lang.String fileOutName,
boolean fill,
boolean isLargeFile,
int extraHeaderBytes)
Deprecated.
For writing parts of a NetcdfFile to a new Netcdf-3 local file.
|
Modifier and Type | Method and Description |
---|---|
static double |
copyVarData(NetcdfFileWriteable ncfile,
java.util.List<Variable> varlist,
Structure recordVar,
java.util.List<FileWriter.FileWriterProgressListener> progressListeners)
Deprecated.
Write data from varList into new file.
|
static double |
copyVarData(NetcdfFileWriteable ncfile,
java.util.List<Variable> varlist,
Structure recordVar,
long delay)
Deprecated.
|
void |
finish()
Deprecated.
Call this when all attributes, dimensions, and variables have been added.
|
NetcdfFileWriteable |
getNetcdf()
Deprecated.
Get underlying NetcdfFileWriteable
|
static void |
main(java.lang.String[] arg)
Deprecated.
Main program.
|
static void |
setDebugFlags(DebugFlags debugFlags)
Deprecated.
Set debugging flags
|
void |
writeAttribute(java.lang.String varName,
Attribute att)
Deprecated.
Write a Variable attribute to the file.
|
Dimension |
writeDimension(Dimension dim)
Deprecated.
Add a Dimension to the file
|
void |
writeGlobalAttribute(Attribute att)
Deprecated.
Write a global attribute to the file.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName)
Deprecated.
Copy a NetcdfFile to a physical file, using Netcdf-3 file format.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName,
boolean fill)
Deprecated.
Copy a NetcdfFile to a physical file, using Netcdf-3 file format.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName,
boolean fill,
boolean isLargeFile)
Deprecated.
Copy a NetcdfFile to a physical file, using Netcdf-3 file format.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName,
boolean fill,
boolean isLargeFile,
java.util.List<FileWriter.FileWriterProgressListener> progressListeners)
Deprecated.
Copy a NetcdfFile to a physical file, using Netcdf-3 file format.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName,
boolean fill,
int delay)
Deprecated.
|
static NetcdfFile |
writeToFile(NetcdfFile fileIn,
java.lang.String fileOutName,
boolean fill,
int delay,
boolean isLargeFile)
Deprecated.
|
void |
writeVariable(Variable oldVar)
Deprecated.
Add a Variable to the file.
|
void |
writeVariables(java.util.List<Variable> varList)
Deprecated.
Add a list of Variables to the file.
|
public FileWriter(java.lang.String fileOutName, boolean fill) throws java.io.IOException
fileOutName
- file name to write to.fill
- use fill mode or notjava.io.IOException
- on badpublic FileWriter(java.lang.String fileOutName, boolean fill, boolean isLargeFile, int extraHeaderBytes) throws java.io.IOException
fileOutName
- file name to write to.fill
- use fill mode or notisLargeFile
- true if large file formatextraHeaderBytes
- add extra bytes in the header, or -1java.io.IOException
- on badpublic static void setDebugFlags(DebugFlags debugFlags)
debugFlags
- debug flagspublic static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName) throws java.io.IOException
fileIn
- write from this NetcdfFilefileOutName
- write to this local filejava.io.IOException
- on read or write errorpublic static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName, boolean fill) throws java.io.IOException
fileIn
- write from this NetcdfFilefileOutName
- write to this local filefill
- use fill modejava.io.IOException
- on read or write errorpublic static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName, boolean fill, boolean isLargeFile) throws java.io.IOException
fileIn
- write from this NetcdfFilefileOutName
- write to this local filefill
- use fill modeisLargeFile
- if true, make large file format (> 2Gb offsets)java.io.IOException
- on read or write errorpublic static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName, boolean fill, boolean isLargeFile, java.util.List<FileWriter.FileWriterProgressListener> progressListeners) throws java.io.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.java.io.IOException
- on read or write errorpublic static double copyVarData(NetcdfFileWriteable ncfile, java.util.List<Variable> varlist, Structure recordVar, java.util.List<FileWriter.FileWriterProgressListener> progressListeners) throws java.io.IOException
ncfile
- write tot this filevarlist
- list of varibles from the original file, with data in themrecordVar
- the record variable from the original file, or null means dont use record variablesprogressListeners
- List of progress event listeners, may be nulljava.io.IOException
- if I/O errorpublic NetcdfFileWriteable getNetcdf()
public void writeGlobalAttribute(Attribute att)
att
- take attribute name, value, from herepublic void writeAttribute(java.lang.String varName, Attribute att)
varName
- name of variable to attach attribute toatt
- take attribute name, value, from herepublic Dimension writeDimension(Dimension dim)
dim
- copy this dimensionpublic void writeVariable(Variable oldVar)
oldVar
- copy this Variable to new file.public void writeVariables(java.util.List<Variable> varList)
varList
- list of Variablepublic void finish() throws java.io.IOException
java.io.IOException
- on read or write errorpublic static double copyVarData(NetcdfFileWriteable ncfile, java.util.List<Variable> varlist, Structure recordVar, long delay) throws java.io.IOException
java.io.IOException
public static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName, boolean fill, int delay) throws java.io.IOException
java.io.IOException
public static NetcdfFile writeToFile(NetcdfFile fileIn, java.lang.String fileOutName, boolean fill, int delay, boolean isLargeFile) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] arg) throws java.io.IOException
ucar.nc2.FileWriter -in fileIn -out fileOut.
where:
arg
- -in fileIn -out fileOutjava.io.IOException
- on read or write error