Class Nc4Iosp

    • Method Detail

      • setLibraryAndPath

        @Deprecated
        public static void setLibraryAndPath​(String jnaPath,
                                             String libName)
        Deprecated.
        use NetcdfClibrary.setLibraryNameAndPath
        set the path and name of the netcdf c library. must be called before load() is called.
        Parameters:
        jnaPath - path to shared libraries
        libName - library name
      • isClibraryPresent

        @Deprecated
        public static boolean isClibraryPresent()
        Deprecated.
        use NetcdfClibrary.isLibraryPresent
        Test if the netcdf C library is present and loaded.
        Returns:
        true if present
      • setLogLevel

        @Deprecated
        public static int setLogLevel​(int level)
        Deprecated.
        use NetcdfClibrary.setLogLevel
        Set the log level for loaded library. Do nothing if set_log_level is not available.
      • useHdfEos

        public static void useHdfEos​(boolean val)
        Deprecated.
      • setDebugFlags

        public static void setDebugFlags​(DebugFlags flags)
        Deprecated.
      • setChunker

        public void setChunker​(Nc4Chunking chunker)
        Deprecated.
      • isValidFile

        public boolean isValidFile​(RandomAccessFile raf)
                            throws IOException
        Deprecated.
        Checks whether raf is a valid file NetCDF-4 file. Actually, it checks whether it is a valid HDF-5 file of any type. Furthermore, it checks whether the NetCDF C library is available on the system. If both conditions are satisfied, this method returns true; otherwise it returns false.
        Specified by:
        isValidFile in interface IOServiceProvider
        Parameters:
        raf - a file on disk.
        Returns:
        true if raf is a valid HDF-5 file and the NetCDF C library is available.
        Throws:
        IOException - if an I/O error occurs.
      • getFileTypeDescription

        public String getFileTypeDescription()
        Deprecated.
        Description copied from interface: IOServiceProvider
        Get a human-readable description for this file type.
        Specified by:
        getFileTypeDescription in interface IOServiceProvider
        Returns:
        description of the file type
        See Also:
        "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
      • getFileTypeId

        public String getFileTypeId()
        Deprecated.
        Description copied from interface: IOServiceProvider
        Get a unique id for this file type.
        Specified by:
        getFileTypeId in interface IOServiceProvider
        Returns:
        registered id of the file type
        See Also:
        "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
      • open

        public void open​(RandomAccessFile raf,
                         NetcdfFile ncfile,
                         CancelTask cancelTask)
                  throws IOException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Open existing file, and populate ncfile with it. This method is only called by the NetcdfFile constructor on itself. The provided NetcdfFile object will be empty except for the location String and the IOServiceProvider associated with this NetcdfFile object.
        Specified by:
        open in interface IOServiceProvider
        Overrides:
        open in class AbstractIOServiceProvider
        Parameters:
        raf - the file to work on, it has already passed the isValidFile() test.
        ncfile - add objects to this empty NetcdfFile
        cancelTask - used to monitor user cancellation; may be null.
        Throws:
        IOException - if read error
      • openForWriting

        public void openForWriting​(RandomAccessFile raf,
                                   NetcdfFile ncfile,
                                   CancelTask cancelTask)
                            throws IOException
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        Open existing file and allow writing. Netcdf-4 writing is general. Netcdf-3 writing is restricted to writing data into existing variables.
        Specified by:
        openForWriting in interface IOServiceProviderWriter
        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
      • dumpbytes

        public static void dumpbytes​(byte[] bytes,
                                     int start,
                                     int len,
                                     String tag)
        Deprecated.
      • readData

        public Array readData​(Variable v2,
                              Section section)
                       throws IOException,
                              InvalidRangeException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Read data from a top level Variable and return a memory resident Array. This Array has the same element type as the Variable, and the requested shape.
        Specified by:
        readData in interface IOServiceProvider
        Parameters:
        v2 - a top-level Variable
        section - the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls allowed. IOSP may not modify.
        Returns:
        the requested data in a memory-resident Array
        Throws:
        IOException - if read error
        InvalidRangeException - if invalid section
        See Also:
        Range
      • show

        public static String show​(SizeT[] inta)
        Deprecated.
      • create

        public void create​(String filename,
                           NetcdfFile ncfile,
                           int extra,
                           long preallocateSize,
                           boolean largeFile)
                    throws IOException
        Deprecated.
        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
        Deprecated.
        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
      • setAddReserved

        public Nc4Iosp setAddReserved​(boolean tf)
        Deprecated.
      • setFill

        public void setFill​(boolean fill)
        Deprecated.
        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
      • updateAttribute

        public void updateAttribute​(Variable v2,
                                    Attribute att)
                             throws IOException
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        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.
        Specified by:
        updateAttribute in interface IOServiceProviderWriter
        Parameters:
        v2 - variable, or null for global attribute
        att - replace with this value
        Throws:
        IOException
      • getNativeAddr

        public static long getNativeAddr​(int pos,
                                         ByteBuffer buf)
        Deprecated.