public abstract class AbstractIOServiceProvider extends Object implements IOServiceProvider
Implementations should make sure to handle the RandomAccessFile properly by doing one of the following:
| Modifier and Type | Field and Description |
|---|---|
protected RandomAccessFile |
raf
Subclasses that use AbstractIOServiceProvider.open(...) or .close()
should use this (instead of their own private variable).
|
| Constructor and Description |
|---|
AbstractIOServiceProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file.
|
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.
|
long |
readToOutputStream(Variable v2,
Section section,
OutputStream out) |
Object |
sendIospMessage(Object message)
A way to communicate arbitrary information to an iosp.
|
long |
streamToByteChannel(Variable v2,
Section section,
WritableByteChannel channel) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFileTypeDescription, getFileTypeId, isValidFile, readDataprotected RandomAccessFile raf
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException
IOServiceProvideropen 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 errorpublic void close()
throws IOException
IOServiceProviderclose in interface IOServiceProviderIOException - if read errorpublic long readToByteChannel(Variable v2, Section section, WritableByteChannel channel) throws IOException, InvalidRangeException
IOServiceProviderreadToByteChannel 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 WritableByteChannelIOException - if read errorInvalidRangeException - if invalid sectionpublic long readToOutputStream(Variable v2, Section section, OutputStream out) throws IOException, InvalidRangeException
readToOutputStream in interface IOServiceProviderIOExceptionInvalidRangeExceptionpublic long streamToByteChannel(Variable v2, Section section, WritableByteChannel channel) throws IOException, InvalidRangeException
streamToByteChannel in interface IOServiceProviderIOExceptionInvalidRangeExceptionpublic Array readSection(ParsedSectionSpec cer) throws IOException, InvalidRangeException
IOServiceProviderreadSection in interface IOServiceProvidercer - section specification : what data is wantedIOException - on read errorInvalidRangeException - if section spec is invalidpublic StructureDataIterator getStructureIterator(Structure s, int bufferSize) throws IOException
getStructureIterator in interface IOServiceProviderIOExceptionpublic Object sendIospMessage(Object message)
IOServiceProvidersendIospMessage in interface IOServiceProvidermessage - opaque message sent to the IOSP object when its opened (not when isValidFile() is called)public boolean syncExtend()
throws IOException
IOServiceProvidersyncExtend in interface IOServiceProviderIOException - if a read error occured when accessing the underlying dataset.public boolean sync()
throws IOException
IOServiceProvidersync in interface IOServiceProviderIOException - if a read error occured when accessing the underlying dataset.public String toStringDebug(Object o)
IOServiceProvidertoStringDebug in interface IOServiceProvidero - which objectpublic String getDetailInfo()
IOServiceProvidergetDetailInfo in interface IOServiceProviderpublic String getFileTypeVersion()
IOServiceProvidergetFileTypeVersion in interface IOServiceProviderCopyright © 1999-2012 UCAR/Unidata. All Rights Reserved.