Package ucar.nc2.iosp

Interface IOServiceProviderWriter

All Superinterfaces:
Comparable<IOServiceProvider>, IOServiceProvider

@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.
  • 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 here
      extra - if > 0, pad header with extra bytes
      preallocateSize - 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 NetcdfFile
      cancelTask - 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 error
      InvalidRangeException - 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 structure
      sdata - 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 attribute
      att - replace with this value
      Throws:
      IOException
    • flush

      void flush() throws IOException
      Deprecated.
      Flush all data buffers to disk.
      Throws:
      IOException