public interface IOServiceProvider extends java.lang.Comparable<IOServiceProvider>
Modifier and Type | Interface and Description |
---|---|
static class |
IOServiceProvider.SortGroup
Used to determine the ordering for dynamically loaded IOServiceProviders.
|
Modifier and Type | Method and Description |
---|---|
void |
build(RandomAccessFile raf,
Group.Builder rootGroup,
CancelTask cancelTask)
Open existing file, and populate it.
|
void |
buildFinish(NetcdfFile ncfile)
Sometimes the builder needs access to the finished objects.
|
void |
close()
Close the file.
|
default int |
compareTo(IOServiceProvider other)
Use the SortGroup to determine the ordering for dynamically loaded IOServiceProviders.
|
java.lang.String |
getDetailInfo()
Show debug / underlying implementation details
|
java.lang.String |
getFileTypeDescription()
Get a human-readable description for this file type.
|
java.lang.String |
getFileTypeId()
Get a unique id for this file type.
|
java.lang.String |
getFileTypeVersion()
Get the version of this file type.
|
default IOServiceProvider.SortGroup |
getSortGroup()
Get the SortGroup for this IOServiceProvider.
|
StructureDataIterator |
getStructureIterator(Structure s,
int bufferSize)
Get the structure iterator.
|
boolean |
isBuilder()
If this iosp implements build().
|
boolean |
isValidFile(RandomAccessFile raf)
Check if this is a valid file for this IOServiceProvider.
|
void |
open(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask)
Deprecated.
Use build(RandomAccessFile raf, Group.Builder rootGroup, CancelTask cancelTask)
|
void |
reacquire()
Reacquire any resources like file handles
Used when reactivating in cache.
|
Array |
readData(Variable v2,
Section section)
Read data from a top level Variable and return a memory resident Array.
|
Array |
readSection(ParsedSectionSpec cer)
Allows reading sections of nested variables
|
long |
readToByteChannel(Variable v2,
Section section,
java.nio.channels.WritableByteChannel channel)
Deprecated.
do not use
|
long |
readToOutputStream(Variable v2,
Section section,
java.io.OutputStream out)
Read data from a top level Variable and send data to a OutputStream.
|
void |
release()
Release any system resources like file handles.
|
java.lang.Object |
sendIospMessage(java.lang.Object message)
A way to communicate arbitrary information to and from an iosp.
|
long |
streamToByteChannel(Variable v2,
Section section,
java.nio.channels.WritableByteChannel channel)
Deprecated.
do not use
|
boolean |
syncExtend()
Deprecated.
Do not use.
|
java.lang.String |
toStringDebug(java.lang.Object o)
Debug info for this object.
|
boolean isValidFile(RandomAccessFile raf) throws java.io.IOException
raf
- RandomAccessFilejava.io.IOException
- if read error@Deprecated void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws java.io.IOException
raf
- 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.java.io.IOException
- if read errorboolean isBuilder()
void build(RandomAccessFile raf, Group.Builder rootGroup, CancelTask cancelTask) throws java.io.IOException
raf
- the file to work on, it has already passed the isValidFile() test.rootGroup
- add objects to the root group.cancelTask
- used to monitor user cancellation; may be null.java.io.IOException
- if read errorvoid buildFinish(NetcdfFile ncfile)
Array readData(Variable v2, Section section) throws java.io.IOException, InvalidRangeException
v2
- 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.java.io.IOException
- if read errorInvalidRangeException
- if invalid sectionRange
@Deprecated long readToByteChannel(Variable v2, Section section, java.nio.channels.WritableByteChannel channel) throws java.io.IOException, InvalidRangeException
v2
- 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 WritableByteChanneljava.io.IOException
- if read errorInvalidRangeException
- if invalid section@Deprecated long streamToByteChannel(Variable v2, Section section, java.nio.channels.WritableByteChannel channel) throws java.io.IOException, InvalidRangeException
java.io.IOException
InvalidRangeException
long readToOutputStream(Variable v2, Section section, java.io.OutputStream out) throws java.io.IOException, InvalidRangeException
v2
- 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 OutputStreamjava.io.IOException
- if read errorInvalidRangeException
- if invalid sectionArray readSection(ParsedSectionSpec cer) throws java.io.IOException, InvalidRangeException
cer
- section specification : what data is wantedjava.io.IOException
- on read errorInvalidRangeException
- if section spec is invalidStructureDataIterator getStructureIterator(Structure s, int bufferSize) throws java.io.IOException
s
- the StructurebufferSize
- the buffersizejava.io.IOException
- if problem reading datavoid close() throws java.io.IOException
java.io.IOException
- if read error@Deprecated boolean syncExtend() throws java.io.IOException
java.io.IOException
- if a read error occured when accessing the underlying dataset.void release() throws java.io.IOException
java.io.IOException
void reacquire() throws java.io.IOException
java.io.IOException
@Nullable java.lang.Object sendIospMessage(@Nullable java.lang.Object message)
message
- opaque message sent to the IOSP object when its opened (not when isValidFile() is called)java.lang.String toStringDebug(java.lang.Object o)
o
- which objectjava.lang.String getDetailInfo()
java.lang.String getFileTypeId()
java.lang.String getFileTypeVersion()
java.lang.String getFileTypeDescription()
default IOServiceProvider.SortGroup getSortGroup()
default int compareTo(IOServiceProvider other)
compareTo
in interface java.lang.Comparable<IOServiceProvider>