Class N3iospWriter

    • Method Detail

      • setFill

        public void setFill​(boolean fill)
        Description copied from interface: IOServiceProviderWriter
        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.
        Specified by:
        setFill in interface IOServiceProviderWriter
        Parameters:
        fill - set fill mode true or false
      • create

        public void create​(String filename,
                           NetcdfFile ncfile,
                           int extra,
                           long preallocateSize,
                           boolean largeFile)
                    throws IOException
        Description copied from interface: IOServiceProviderWriter
        Create new file, populate it from the objects in ncfile.
        Specified by:
        create in interface IOServiceProviderWriter
        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
      • writeData

        public void writeData​(Variable v2,
                              Section section,
                              Array values)
                       throws IOException,
                              InvalidRangeException
        Description copied from interface: IOServiceProviderWriter
        Write data into a variable.
        Specified by:
        writeData in interface IOServiceProviderWriter
        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
      • updateAttribute

        public void updateAttribute​(Variable v2,
                                    Attribute att)
                             throws IOException
        Update the value of an existing attribute on disk, not in memory. 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.
        Specified by:
        updateAttribute in interface IOServiceProviderWriter
        Parameters:
        v2 - variable, or null for global attribute
        att - replace with this value
        Throws:
        IOException
      • syncExtend

        public boolean syncExtend()
                           throws IOException
        Description copied from interface: IOServiceProvider
        Extend the NetcdfFile if the underlying dataset has changed in a way that is compatible with the current metadata. For example, if the unlimited dimension has grown.
        Specified by:
        syncExtend in interface IOServiceProvider
        Overrides:
        syncExtend in class N3iospNew
        Returns:
        true if the NetcdfFile was extended.
        Throws:
        IOException - if a read error occured when accessing the underlying dataset.