Package ucar.nc2.iosp
Interface IOServiceProviderWriter
- All Superinterfaces:
Comparable<IOServiceProvider>,IOServiceProvider
Deprecated.
This will be internal in ver6.
This is an interface to Netcdf-3 and Netcdf-4 file writing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider
IOServiceProvider.SortGroup -
Method Summary
Modifier and TypeMethodDescriptionintappendStructureData(Structure s, StructureData sdata) Deprecated.Append a structureData along the unlimited dimensionvoidcreate(String filename, NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) Deprecated.Create new file, populate it from the objects in ncfile.voidflush()Deprecated.Flush all data buffers to disk.voidopenForWriting(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) Deprecated.Open existing file and allow writing.booleanrewriteHeader(boolean largeFile) Deprecated.if theres room before data, rewrite header without moving the data.voidsetFill(boolean fill) Deprecated.Set the fill flag.voidupdateAttribute(Variable v2, Attribute att) Deprecated.Update the value of an existing attribute.voidDeprecated.Write data into a variable.Methods inherited from interface ucar.nc2.iosp.IOServiceProvider
build, buildFinish, close, compareTo, getDetailInfo, getFileTypeDescription, getFileTypeId, getFileTypeVersion, getSortGroup, getStructureIterator, isBuilder, isValidFile, open, reacquire, readData, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, streamToByteChannel, syncExtend, toStringDebug
-
Method Details
-
create
void create(String filename, NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) throws IOException Deprecated.Create new file, populate it from the objects in ncfile.- Parameters:
filename- name of file to create.ncfile- get everything but data from hereextra- if > 0, pad header with extra bytespreallocateSize- if > 0, set length of file to this upon creation - this (usually) pre-allocates contiguous storage.largeFile- if want large file format- Throws:
IOException- if I/O error
-
openForWriting
void openForWriting(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException Deprecated.Open existing file and allow writing. Netcdf-4 writing is general. Netcdf-3 writing is restricted to writing data into existing variables.- Parameters:
raf- the file to work on.ncfile- add objects to this empty NetcdfFilecancelTask- used to monitor user cancellation; may be null.- Throws:
IOException- if I/O error
-
setFill
void setFill(boolean fill) Deprecated.Set the fill flag. For new files, set in the create() method. This method is to set fill for existing files that you want to write. If true, the data is first written with fill values. Set to false if you expect to write all data values, set to true if you want to be sure that unwritten data values have the fill value in it.- Parameters:
fill- set fill mode true or false
-
writeData
void writeData(Variable v2, Section section, Array values) throws IOException, InvalidRangeException Deprecated.Write data into a variable.- Parameters:
v2- variable to write; must already exist.section- the section of data to write. There must be a Range for each Dimension in the variable, in order. The shape must match the shape of values. The origin and stride indicate where the data is placed into the stored Variable array.values- data to write. The shape must match section.getShape().- Throws:
IOException- if I/O errorInvalidRangeException- if invalid section
-
appendStructureData
Deprecated.Append a structureData along the unlimited dimension- Parameters:
s- belongs to this structuresdata- the stuctureData to append- Returns:
- the recnum where it was written
- Throws:
IOExceptionInvalidRangeException
-
rewriteHeader
Deprecated.if theres room before data, rewrite header without moving the data. netcdf3 only- Returns:
- true if it worked
- Throws:
IOException
-
updateAttribute
Deprecated.Update the value of an existing attribute. Attribute is found by name, which must match exactly. You cannot make an attribute longer, or change the number of values. For strings: truncate if longer, zero fill if shorter. Strings are padded to 4 byte boundaries, ok to use padding if it exists. For numerics: must have same number of values.- Parameters:
v2- variable, or null for global attributeatt- replace with this value- Throws:
IOException
-
flush
Deprecated.Flush all data buffers to disk.- Throws:
IOException
-