Package ucar.nc2.write
Class NetcdfFormatWriter.Builder
java.lang.Object
ucar.nc2.write.NetcdfFormatWriter.Builder
- Enclosing class:
- NetcdfFormatWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(Attribute att) Add a global attributeaddDimension(String dimName, int length) Add a dimension to the root group.addDimension(Dimension dim) Add a dimension to the root group.addStructure(String shortName, String dimString) Add a Structure to the root group.addUnlimitedDimension(String dimName) Add an unlimited dimension to the root group.addVariable(String shortName, DataType dataType, String dimString) Add a Variable to the root group.addVariable(String shortName, DataType dataType, List<Dimension> dims) Add a Variable to the root group.build()Once this is called, do not use the Builder again.longcalcSize()getIosp()Get the root groupsetChunker(Nc4Chunking chunker) Nc4Chunking, used only for netcdf4setExtraHeader(int extraHeaderBytes) Set extra bytes to reserve in the header.setFill(boolean fill) Set the fill flag.setFormat(NetcdfFileFormat format) Set the format version.setIosp(IOServiceProvider iosp) setLocation(String location) The file locatipnsetNewFile(boolean newFile) True if its a new file, false if its an existing file.setPreallocateSize(long preallocateSize) Preallocate the file size, for efficiency.setRootGroup(Group.Builder rootGroup) Set the root group.setUseJna(boolean useJna) Set if you want to use JNA / netcdf c library to do the writing.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setLocation
The file locatipn -
setIosp
-
getIosp
-
setFormat
Set the format version. Only needed when its a new file. Default is NetcdfFileFormat.NETCDF3 -
getFormat
-
setNewFile
True if its a new file, false if its an existing file. Default true. -
setFill
Set the fill flag. Only used by netcdf-3. If true, the data is first written with fill values. Default is fill = true, to follow the C library. Set false if you expect to write all data values, which makes writing faster. Set true if you want to be sure that unwritten data values are set to the fill value. -
setExtraHeader
Set extra bytes to reserve in the header. Only used by netcdf-3. This can prevent rewriting the entire file on redefine.- Parameters:
extraHeaderBytes- # bytes extra for the header
-
setPreallocateSize
Preallocate the file size, for efficiency. Only used by netcdf-3. -
setChunker
Nc4Chunking, used only for netcdf4 -
setUseJna
Set if you want to use JNA / netcdf c library to do the writing. Default is false. -
addAttribute
Add a global attribute -
addDimension
Add a dimension to the root group. -
addDimension
Add a dimension to the root group. -
addUnlimitedDimension
Add an unlimited dimension to the root group. -
getRootGroup
Get the root group -
setRootGroup
Set the root group. This allows all metadata to be built externally. -
addVariable
Add a Variable to the root group. -
addVariable
Add a Variable to the root group. -
addStructure
Add a Structure to the root group. -
calcSize
public long calcSize() -
build
Once this is called, do not use the Builder again.- Throws:
IOException
-