ucar.nc2.iosp.bufr
Class BufrIosp

java.lang.Object
  extended by ucar.nc2.iosp.AbstractIOServiceProvider
      extended by ucar.nc2.iosp.bufr.BufrIosp
All Implemented Interfaces:
IOServiceProvider

public class BufrIosp
extends AbstractIOServiceProvider

IOSP for BUFR data

Author:
caron

Field Summary
static String obsRecord
           
 
Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
raf
 
Constructor Summary
BufrIosp()
           
 
Method Summary
 void compare(Structure obs)
           
static void doon(String filename)
           
 String getDetailInfo()
          Show debug / underlying implementation details
 String getFileTypeDescription()
          Get a human-readable description for this file type.
 String getFileTypeId()
          Get a unique id for this file type.
 StructureDataIterator getStructureIterator(Structure s, int bufferSize)
          Get the structure iterator
 boolean isValidFile(RandomAccessFile raf)
          Check if this is a valid file for this IOServiceProvider.
static void main(String[] arg)
           
 void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask)
          Open existing file, and populate ncfile with it.
 void readAll(boolean dump)
           
 Array readData(Variable v2, Section section)
          Read data from a top level Variable and return a memory resident Array.
static void setDebugFlags(DebugFlags debugFlag)
           
 
Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider
close, getFileTypeVersion, 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

obsRecord

public static final String obsRecord
See Also:
Constant Field Values
Constructor Detail

BufrIosp

public BufrIosp()
Method Detail

setDebugFlags

public static void setDebugFlags(DebugFlags debugFlag)

isValidFile

public boolean isValidFile(RandomAccessFile raf)
                    throws IOException
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.
Throws:
IOException - if read error

open

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

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

readData

public Array readData(Variable v2,
                      Section section)
               throws 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:
IOException - if read error
InvalidRangeException - if invalid section
See Also:
Range

getStructureIterator

public StructureDataIterator getStructureIterator(Structure s,
                                                  int bufferSize)
                                           throws IOException
Get the structure iterator

Specified by:
getStructureIterator in interface IOServiceProvider
Overrides:
getStructureIterator in class AbstractIOServiceProvider
Parameters:
s - the Structure
bufferSize - the buffersize
Returns:
the data iterator
Throws:
IOException - if problem reading data

getDetailInfo

public String getDetailInfo()
Description copied from interface: IOServiceProvider
Show debug / underlying implementation details

Specified by:
getDetailInfo in interface IOServiceProvider
Overrides:
getDetailInfo in class AbstractIOServiceProvider
Returns:
debug info

getFileTypeId

public String getFileTypeId()
Description copied from interface: IOServiceProvider
Get a unique id for this file type.

Returns:
registered id of the file type
See Also:
"http://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"

getFileTypeDescription

public String getFileTypeDescription()
Description copied from interface: IOServiceProvider
Get a human-readable description for this file type.

Returns:
description of the file type
See Also:
"http://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"

readAll

public void readAll(boolean dump)
             throws IOException,
                    InvalidRangeException
Throws:
IOException
InvalidRangeException

compare

public void compare(Structure obs)
             throws IOException,
                    InvalidRangeException
Throws:
IOException
InvalidRangeException

doon

public static void doon(String filename)
                 throws IOException,
                        InvalidRangeException
Throws:
IOException
InvalidRangeException

main

public static void main(String[] arg)
                 throws IOException,
                        InvalidRangeException
Throws:
IOException
InvalidRangeException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.