ucar.nc2.iosp.gini
Class Giniiosp

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.gini.Giniiosp
All Implemented Interfaces:
IOServiceProvider

public class Giniiosp
extends AbstractIOServiceProvider

IOServiceProvider for GINI files.


Field Summary
protected  boolean debug
           
protected  boolean debugSize
           
protected  boolean debugSPIO
           
protected  java.util.HashMap dimHash
           
protected  int fileUsed
           
protected  boolean fill
           
protected  ucar.nc2.iosp.gini.Giniheader headerParser
           
protected  boolean readonly
           
protected  int recStart
           
protected  boolean showHeaderBytes
           
 
Constructor Summary
Giniiosp()
           
 
Method Summary
 void close()
          Close the file.
 void flush()
           
 boolean isValidFile(RandomAccessFile raf)
          Check if this is a valid file for this IOServiceProvider.
static void main(java.lang.String[] args)
           
 void open(RandomAccessFile raf, NetcdfFile file, CancelTask cancelTask)
          Open existing file, and populate ncfile with it.
 Array readCompressedData(Variable v2, long dataPos, int[] origin, int[] shape, int[] stride, int[] levels)
           
 Array readCompressedZlib(Variable v2, long dataPos, int nx, int ny, int[] origin, int[] shape, int[] stride, int[] levels)
           
 Array readData(Variable v2, Section section)
          Read data from a top level Variable and return a memory resident Array.
 Array readDataOld(Variable v2, long dataPos, int[] origin, int[] shape, int[] stride)
           
 Array readNestedData(Variable v2, java.util.List section)
           
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
createValidNetcdfObjectName, getDetailInfo, getStructureIterator, readSection, readToByteChannel, sendIospMessage, sync, syncExtend, toStringDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readonly

protected boolean readonly

headerParser

protected ucar.nc2.iosp.gini.Giniheader headerParser

fileUsed

protected int fileUsed

recStart

protected int recStart

debug

protected boolean debug

debugSize

protected boolean debugSize

debugSPIO

protected boolean debugSPIO

showHeaderBytes

protected boolean showHeaderBytes

fill

protected boolean fill

dimHash

protected java.util.HashMap dimHash
Constructor Detail

Giniiosp

public Giniiosp()
Method Detail

readNestedData

public Array readNestedData(Variable v2,
                            java.util.List section)
                     throws java.io.IOException,
                            InvalidRangeException
Throws:
java.io.IOException
InvalidRangeException

isValidFile

public boolean isValidFile(RandomAccessFile raf)
Description copied from interface: IOServiceProvider
Check if this is a valid file for this IOServiceProvider. You must make this method thread safe, ie dont keep any state.

Parameters:
raf - RandomAccessFile
Returns:
true if valid.

open

public void open(RandomAccessFile raf,
                 NetcdfFile file,
                 CancelTask cancelTask)
          throws java.io.IOException
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.

Parameters:
raf - the file to work on, it has already passed the isValidFile() test.
file - add objects to this empty NetcdfFile
cancelTask - used to monitor user cancellation; may be null.
Throws:
java.io.IOException - if read error

readData

public Array readData(Variable v2,
                      Section section)
               throws java.io.IOException,
                      InvalidRangeException
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.

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:
java.io.IOException - if read error
InvalidRangeException - if invalid section
See Also:
Range

readDataOld

public Array readDataOld(Variable v2,
                         long dataPos,
                         int[] origin,
                         int[] shape,
                         int[] stride)
                  throws java.io.IOException,
                         InvalidRangeException
Throws:
java.io.IOException
InvalidRangeException

readCompressedData

public Array readCompressedData(Variable v2,
                                long dataPos,
                                int[] origin,
                                int[] shape,
                                int[] stride,
                                int[] levels)
                         throws java.io.IOException,
                                InvalidRangeException
Throws:
java.io.IOException
InvalidRangeException

readCompressedZlib

public Array readCompressedZlib(Variable v2,
                                long dataPos,
                                int nx,
                                int ny,
                                int[] origin,
                                int[] shape,
                                int[] stride,
                                int[] levels)
                         throws java.io.IOException,
                                InvalidRangeException
Throws:
java.io.IOException
InvalidRangeException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: IOServiceProvider
Close the file. It is the IOServiceProvider's job to close the file (even though it didnt open it), and to free any other resources it has used.

Throws:
java.io.IOException - if read error

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception,
                        java.io.IOException,
                        java.lang.InstantiationException,
                        java.lang.IllegalAccessException
Throws:
java.lang.Exception
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException