Package ucar.nc2
Class FileWriter2
- java.lang.Object
-
- ucar.nc2.FileWriter2
-
@Deprecated public class FileWriter2 extends Object
Deprecated.useNetcdfCopier(library) orNccopy(command line)Utility class for copying a NetcdfFile object, or parts of one, to a netcdf-3 or netcdf-4 disk file. Uses NetcdfFileWriter. This handles the entire CDM model (groups, etc) if you are writing to netcdf-4. The fileIn may be an NcML file which has a referenced dataset in the location URL, the underlying data (modified by the NcML) is written to the new file. If the NcML does not have a referenced dataset, then the new file is filled with fill values, like ncgen. Use NetcdfFileWriter object for a lower level API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileWriter2.ChunkingIndexDeprecated.use ucar.nc2.write.ChunkingIndexstatic classFileWriter2.N3StructureStrategyDeprecated.do not use
-
Constructor Summary
Constructors Constructor Description FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker)Deprecated.Use this constructor to copy entire file.FileWriter2(NetcdfFileWriter fileWriter)Deprecated.Use this constructor to copy specific variables to new file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description VariableaddVariable(Variable oldVar)Deprecated.Specify which variable will get writtendoublecopyVarData(List<Variable> oldVars, Structure recordVar, CancelTask cancel)Deprecated.Write data from varList into new file.NetcdfFileWritergetNetcdfFileWriter()Deprecated.static voidmain(String[] arg)Deprecated.use ucar.nc2.write.Nccopystatic voidsetDebugFlags(DebugFlags debugFlags)Deprecated.Set debugging flagsvoidsetN3StructureStrategy(FileWriter2.N3StructureStrategy n3StructureStrategy)Deprecated.NetcdfFilewrite()Deprecated.NetcdfFilewrite(CancelTask cancel)Deprecated.Write the input file to the output file.
-
-
-
Constructor Detail
-
FileWriter2
public FileWriter2(NetcdfFile fileIn, String fileOutName, NetcdfFileWriter.Version version, Nc4Chunking chunker) throws IOException
Deprecated.Use this constructor to copy entire file. Use this.write() to do actual copy.- Parameters:
fileIn- copy this filefileOutName- to this output fileversion- output file versionchunker- chunking strategy (netcdf4 only)- Throws:
IOException- on read/write error
-
FileWriter2
public FileWriter2(NetcdfFileWriter fileWriter)
Deprecated.Use this constructor to copy specific variables to new file. Only supports classic mode Use addVariable() to load in variables, then this.write().- Parameters:
fileWriter- this encapsolates new file.
-
-
Method Detail
-
setDebugFlags
public static void setDebugFlags(DebugFlags debugFlags)
Deprecated.Set debugging flags- Parameters:
debugFlags- debug flags
-
setN3StructureStrategy
public void setN3StructureStrategy(FileWriter2.N3StructureStrategy n3StructureStrategy)
Deprecated.
-
getNetcdfFileWriter
public NetcdfFileWriter getNetcdfFileWriter()
Deprecated.
-
addVariable
public Variable addVariable(Variable oldVar)
Deprecated.Specify which variable will get written- Parameters:
oldVar- add this variable, and all parent groups- Returns:
- new Variable.
-
write
public NetcdfFile write() throws IOException
Deprecated.- Throws:
IOException
-
write
public NetcdfFile write(CancelTask cancel) throws IOException
Deprecated.Write the input file to the output file.- Parameters:
cancel- allow user to cancel; may be null.- Returns:
- the open output file.
- Throws:
IOException
-
copyVarData
public double copyVarData(List<Variable> oldVars, Structure recordVar, CancelTask cancel) throws IOException
Deprecated.Write data from varList into new file. Read/Write a maximum of maxSize bytes at a time. When theres a record variable, its much more efficient to use it.- Parameters:
oldVars- list of variables from the original file, with data in themrecordVar- the record variable from the original file, or null means dont use record variablescancel- allow user to cancel, may be null.- Returns:
- total number of bytes written
- Throws:
IOException- if I/O error
-
main
@Deprecated public static void main(String[] arg) throws IOException
Deprecated.use ucar.nc2.write.Nccopyucar.nc2.FileWriter -in fileIn -out fileOut.where:
- fileIn : path of any CDM readable file
- fileOut: local pathname where netdf-3 file will be written
- Parameters:
arg- -in fileIn -out fileOut [-netcdf4]- Throws:
IOException- on read or write error
-
-