Package ucar.nc2.iosp
Interface IOServiceProviderWriter
-
- All Superinterfaces:
Comparable<IOServiceProvider>
,IOServiceProvider
- All Known Implementing Classes:
N3iosp
,N3iospWriter
,N3raf
,Nc4Iosp
@Deprecated public interface IOServiceProviderWriter extends 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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
appendStructureData(Structure s, StructureData sdata)
Deprecated.Append a structureData along the unlimited dimensionvoid
create(String filename, NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile)
Deprecated.Create new file, populate it from the objects in ncfile.void
flush()
Deprecated.Flush all data buffers to disk.void
openForWriting(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
Deprecated.Open existing file and allow writing.boolean
rewriteHeader(boolean largeFile)
Deprecated.if theres room before data, rewrite header without moving the data.void
setFill(boolean fill)
Deprecated.Set the fill flag.void
updateAttribute(Variable v2, Attribute att)
Deprecated.Update the value of an existing attribute.void
writeData(Variable v2, Section section, Array values)
Deprecated.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 Detail
-
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
int appendStructureData(Structure s, StructureData sdata) throws IOException, InvalidRangeException
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:
IOException
InvalidRangeException
-
rewriteHeader
boolean rewriteHeader(boolean largeFile) throws IOException
Deprecated.if theres room before data, rewrite header without moving the data. netcdf3 only- Returns:
- true if it worked
- Throws:
IOException
-
updateAttribute
void updateAttribute(Variable v2, Attribute att) throws IOException
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
void flush() throws IOException
Deprecated.Flush all data buffers to disk.- Throws:
IOException
-
-