|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectucar.nc2.iosp.AbstractIOServiceProvider
public abstract class AbstractIOServiceProvider
Abstract base class for IOSP implementations that provides default implementations of readToByteChannel(...) and readSection(...).
Implementations should make sure to handle the RandomAccessFile properly by doing one of the following:
| Field Summary | |
|---|---|
protected RandomAccessFile |
raf
Subclasses that use AbstractIOServiceProvider.open(...) or .close() should use this (instead of their own private variable). |
| Constructor Summary | |
|---|---|
AbstractIOServiceProvider()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the file. |
static String |
createValidNetcdfObjectName(String name)
|
String |
getDetailInfo()
Show debug / underlying implementation details |
String |
getFileTypeVersion()
Get the version of this file type. |
StructureDataIterator |
getStructureIterator(Structure s,
int bufferSize)
|
void |
open(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask)
Open existing file, and populate ncfile with it. |
Array |
readSection(ParsedSectionSpec cer)
Allows reading sections of nested variables |
long |
readToByteChannel(Variable v2,
Section section,
WritableByteChannel channel)
Read data from a top level Variable and send data to a WritableByteChannel. |
Object |
sendIospMessage(Object message)
A way to communicate arbitrary information to an iosp. |
boolean |
sync()
Update the metadata in the NetcdfFile if the underlying dataset has changed. |
boolean |
syncExtend()
Extend the NetcdfFile if the underlying dataset has changed in a way that is compatible with the current metadata. |
String |
toStringDebug(Object o)
Debug info for this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ucar.nc2.iosp.IOServiceProvider |
|---|
getFileTypeDescription, getFileTypeId, isValidFile, readData |
| Field Detail |
|---|
protected RandomAccessFile raf
| Constructor Detail |
|---|
public AbstractIOServiceProvider()
| Method Detail |
|---|
public static String createValidNetcdfObjectName(String name)
public void open(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask)
throws IOException
IOServiceProvider
open in interface IOServiceProviderraf - the file to work on, it has already passed the isValidFile() test.ncfile - add objects to this empty NetcdfFilecancelTask - used to monitor user cancellation; may be null.
IOException - if read error
public void close()
throws IOException
IOServiceProvider
close in interface IOServiceProviderIOException - if read error
public long readToByteChannel(Variable v2,
Section section,
WritableByteChannel channel)
throws IOException,
InvalidRangeException
IOServiceProvider
readToByteChannel in interface IOServiceProviderv2 - a top-level Variablesection - 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.channel - write data to this WritableByteChannel
IOException - if read error
InvalidRangeException - if invalid section
public Array readSection(ParsedSectionSpec cer)
throws IOException,
InvalidRangeException
IOServiceProvider
readSection in interface IOServiceProvidercer - section specification : what data is wanted
IOException - on read error
InvalidRangeException - if section spec is invalid
public StructureDataIterator getStructureIterator(Structure s,
int bufferSize)
throws IOException
getStructureIterator in interface IOServiceProviderIOExceptionpublic Object sendIospMessage(Object message)
IOServiceProvider
sendIospMessage in interface IOServiceProvidermessage - opaque message.
public boolean syncExtend()
throws IOException
IOServiceProvider
syncExtend in interface IOServiceProviderIOException - if a read error occured when accessing the underlying dataset.
public boolean sync()
throws IOException
IOServiceProvider
sync in interface IOServiceProviderIOException - if a read error occured when accessing the underlying dataset.public String toStringDebug(Object o)
IOServiceProvider
toStringDebug in interface IOServiceProvidero - which object
public String getDetailInfo()
IOServiceProvider
getDetailInfo in interface IOServiceProviderpublic String getFileTypeVersion()
IOServiceProvider
getFileTypeVersion in interface IOServiceProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||