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 String |
location |
protected NetcdfFile |
ncfile |
protected RandomAccessFile |
raf
Subclasses that use AbstractIOServiceProvider.open(...) or close()
should use this (instead of their own private variable).
|
protected int |
rafOrder |
| Constructor and Description |
|---|
AbstractIOServiceProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildFinish(NetcdfFile ncfile)
Sometimes the builder needs access to the finished objects.
|
void |
close()
Close the file.
|
String |
getDetailInfo()
Show debug / underlying implementation details
|
String |
getFileTypeVersion()
Get the version of this file type.
|
long |
getLastModified()
Returns the time that the underlying file(s) were last modified.
|
Iterator<StructureData> |
getStructureDataArrayIterator(Sequence s,
int bufferSize)
Get the structure iterator.
|
StructureDataIterator |
getStructureIterator(Structure s,
int bufferSize)
Deprecated.
do not use.
|
void |
open(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask) |
void |
reacquire()
Reacquire any resources like file handles
Used when reactivating in cache.
|
Array<?> |
readArrayData(Variable v2,
Section section)
Read data from a top level Variable and return a memory resident Array.
|
Array |
readSection(ParsedSectionSpec cer)
Deprecated.
do not use.
|
long |
readToOutputStream(Variable v2,
Section section,
OutputStream out)
Deprecated.
do not use.
|
void |
release()
Release any system resources like file handles.
|
Object |
sendIospMessage(Object message)
A way to communicate arbitrary information to and from an iosp.
|
void |
setNetcdfFile(NetcdfFile ncfile) |
String |
toStringDebug(Object o)
Debug info for this object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuild, getFileTypeDescription, getFileTypeId, isValidFile, readDataprotected RandomAccessFile raf
protected String location
protected int rafOrder
protected NetcdfFile ncfile
public void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException
IOExceptionpublic void setNetcdfFile(NetcdfFile ncfile)
public void buildFinish(NetcdfFile ncfile)
IOServiceProviderbuildFinish in interface IOServiceProviderpublic void close()
throws IOException
IOServiceProviderclose in interface Closeableclose in interface AutoCloseableclose in interface IOServiceProviderIOException - if read errorpublic void release()
throws IOException
IOServiceProviderrelease in interface IOServiceProviderIOExceptionpublic void reacquire()
throws IOException
IOServiceProviderreacquire in interface IOServiceProviderIOExceptionpublic Array<?> readArrayData(Variable v2, Section section) throws IOException, InvalidRangeException
IOServiceProviderreadArrayData 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.IOExceptionInvalidRangeException@Deprecated public long readToOutputStream(Variable v2, Section section, OutputStream out) throws IOException, InvalidRangeException
IOServiceProviderreadToOutputStream 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.out - write data to this OutputStreamIOException - if read errorInvalidRangeException - if invalid section@Deprecated public Array readSection(ParsedSectionSpec cer) throws IOException, InvalidRangeException
readSection in interface IOServiceProviderIOExceptionInvalidRangeException@Deprecated public StructureDataIterator getStructureIterator(Structure s, int bufferSize)
getStructureIterator in interface IOServiceProviderpublic Iterator<StructureData> getStructureDataArrayIterator(Sequence s, int bufferSize)
IOServiceProvidergetStructureDataArrayIterator in interface IOServiceProviders - the StructurebufferSize - the buffersize, may be -1 for default.@Nullable public Object sendIospMessage(@Nullable Object message)
IOServiceProvidersendIospMessage in interface IOServiceProvidermessage - opaque message sent to the IOSP object when its opened (not when isValidFile() is called)public long getLastModified()
FileFactory.getLastModified in interface IOServiceProviderlong value representing the time the file(s) were last modified or 0L if the
last-modified time couldn't be determined for any reason.public String toStringDebug(Object o)
IOServiceProvidertoStringDebug in interface IOServiceProvidero - which objectpublic String getDetailInfo()
IOServiceProvidergetDetailInfo in interface IOServiceProviderpublic String getFileTypeVersion()
IOServiceProvidergetFileTypeVersion in interface IOServiceProvider