ucar.nc2
Interface IOServiceProviderWriter

All Superinterfaces:
IOServiceProvider

public interface IOServiceProviderWriter
extends IOServiceProvider

This is the service provider interface for the low-level I/O writing. This is only used by service implementors.

Version:
$Revision:51 $ $Date:2006-07-12 17:13:13Z $
Author:
caron

Method Summary
 void create(java.lang.String filename, NetcdfFile ncfile, boolean fill)
          Create new file, populate it from the objects in ncfile.
 void create(java.lang.String filename, NetcdfFile ncfile, boolean fill, long size)
          Experimental
 void flush()
          Flush all data buffers to disk.
 void setFill(boolean fill)
          Set the fill flag.
 void updateAttribute(Variable v2, Attribute att)
          Update the value of an existing attribute.
 void writeData(Variable v2, java.util.List section, Array values)
          Write data into a variable.
 
Methods inherited from interface ucar.nc2.IOServiceProvider
close, getDetailInfo, isValidFile, open, readData, readNestedData, setSpecial, sync, syncExtend, toStringDebug
 

Method Detail

create

void create(java.lang.String filename,
            NetcdfFile ncfile,
            boolean fill)
            throws java.io.IOException
Create new file, populate it from the objects in ncfile.

Parameters:
filename - name of file to create.
ncfile - get dimensions, attributes, and variables from here.
fill - if true, write fill value into all variables.
Throws:
java.io.IOException

setFill

void setFill(boolean fill)
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. Leave 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

create

void create(java.lang.String filename,
            NetcdfFile ncfile,
            boolean fill,
            long size)
            throws java.io.IOException
Experimental

Throws:
java.io.IOException

writeData

void writeData(Variable v2,
               java.util.List section,
               Array values)
               throws java.io.IOException,
                      InvalidRangeException
Write data into a variable.

Parameters:
v2 - variable to write; must already exist.
section - List of type Range specifying 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.
values - data to write. The shape must match the shape of Range list.
Throws:
java.io.IOException
InvalidRangeException

updateAttribute

void updateAttribute(Variable v2,
                     Attribute att)
                     throws java.io.IOException
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 attribute
att - replace with this value
Throws:
java.io.IOException

flush

void flush()
           throws java.io.IOException
Flush all data buffers to disk.

Throws:
java.io.IOException