public class N3iospNew extends AbstractIOServiceProvider implements IOServiceProvider
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
debug |
protected boolean |
debugRead |
protected boolean |
debugRecord |
protected N3headerNew |
header |
protected long |
lastModified |
protected boolean |
useRecordStructure |
location, ncfile, raf, rafOrder| Constructor and Description |
|---|
N3iospNew() |
| Modifier and Type | Method and Description |
|---|---|
void |
build(RandomAccessFile raf,
Group.Builder rootGroup,
CancelTask cancelTask)
Open existing file, and populate it.
|
void |
close()
Close the file.
|
protected N3headerNew |
createHeader()
Create header for reading netcdf file.
|
void |
flush() |
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.
|
protected Optional<Charset> |
getValueCharset()
Return
value charset if it was defined. |
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)
Open existing file, and populate ncfile with it.
|
void |
reacquire()
Reacquire any resources like file handles
Used when reactivating in cache.
|
protected Object |
readData(Layout index,
DataType dataType)
Read data subset from file for a variable, create primitive array.
|
protected long |
readData(Layout index,
DataType dataType,
WritableByteChannel out)
Read data subset from file for a variable, to WritableByteChannel.
|
Array |
readData(Variable v2,
Section section)
Read data from a top level Variable and return a memory resident Array.
|
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.
|
protected void |
setValueCharset(Charset charset)
Define
value charset. |
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.
|
buildFinish, getFileTypeVersion, getLastModified, getStructureIterator, readSection, readToOutputStream, release, setNetcdfFile, streamToByteChannelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildFinish, getFileTypeVersion, getStructureIterator, readSection, readToOutputStream, release, streamToByteChannelprotected N3headerNew header
protected long lastModified
protected boolean debug
protected boolean debugRecord
protected boolean debugRead
protected boolean useRecordStructure
public boolean isValidFile(RandomAccessFile raf) throws IOException
IOServiceProviderisValidFile in interface IOServiceProviderraf - RandomAccessFileIOException - if read errorpublic String getDetailInfo()
IOServiceProvidergetDetailInfo in interface IOServiceProvidergetDetailInfo in class AbstractIOServiceProviderpublic void open(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws IOException
IOServiceProvideropen in interface IOServiceProvideropen in class AbstractIOServiceProviderraf - 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 boolean isBuilder()
IOServiceProviderisBuilder in interface IOServiceProviderisBuilder in class AbstractIOServiceProviderpublic void build(RandomAccessFile raf, Group.Builder rootGroup, CancelTask cancelTask) throws IOException
IOServiceProviderbuild in interface IOServiceProviderbuild in class AbstractIOServiceProviderraf - 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.IOException - if read errorprotected N3headerNew createHeader()
public Array readData(Variable v2, Section section) throws IOException, InvalidRangeException
IOServiceProviderreadData 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.IOException - if read errorInvalidRangeException - if invalid sectionRangepublic long readToByteChannel(Variable v2, Section section, WritableByteChannel channel) throws IOException, InvalidRangeException
IOServiceProviderreadToByteChannel in interface IOServiceProviderreadToByteChannel in class AbstractIOServiceProviderv2 - 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 boolean syncExtend()
throws IOException
IOServiceProvidersyncExtend in interface IOServiceProvidersyncExtend in class AbstractIOServiceProviderIOException - if a read error occured when accessing the underlying dataset.public void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOServiceProviderclose in interface IOServiceProviderclose in class AbstractIOServiceProviderIOException - if read errorpublic void reacquire()
throws IOException
IOServiceProviderreacquire in interface IOServiceProviderreacquire in class AbstractIOServiceProviderIOExceptionpublic String toStringDebug(Object o)
toStringDebug in interface IOServiceProvidertoStringDebug in class AbstractIOServiceProvidero - which objectpublic Object sendIospMessage(Object message)
IOServiceProvidersendIospMessage in interface IOServiceProvidersendIospMessage in class AbstractIOServiceProvidermessage - opaque message sent to the IOSP object when its opened (not when isValidFile() is called)protected Optional<Charset> getValueCharset()
value charset if it was defined. Definition of charset
occurs by sending a charset as a message using the sendIospMessage(java.lang.Object)
method.value charset if it was defined.protected void setValueCharset(@Nullable Charset charset)
value charset.charset - may be null.public String getFileTypeId()
IOServiceProvidergetFileTypeId in interface IOServiceProviderpublic String getFileTypeDescription()
IOServiceProvidergetFileTypeDescription in interface IOServiceProviderprotected Object readData(Layout index, DataType dataType) throws IOException
index - handles skipping around in the file.dataType - dataType of the variableIOExceptionprotected long readData(Layout index, DataType dataType, WritableByteChannel out) throws IOException
index - handles skipping around in the file.dataType - dataType of the variableIOException