public class Nc4Iosp
extends ucar.nc2.iosp.AbstractIOServiceProvider
implements ucar.nc2.iosp.IOServiceProviderWriter
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
protected static java.lang.String |
DEFAULTNETCDF4LIBNAME |
static java.lang.String |
JNA_PATH |
static java.lang.String |
JNA_PATH_ENV |
static java.lang.String |
TRANSLATE_NC4 |
static java.lang.String |
TRANSLATE_NONE |
static java.lang.String |
TRANSLATECONTROL |
static java.lang.String |
UCARTAGOPAQUE |
static java.lang.String |
UCARTAGORIGTYPE |
static java.lang.String |
UCARTAGVLEN |
| Constructor and Description |
|---|
Nc4Iosp() |
Nc4Iosp(ucar.nc2.NetcdfFileWriter.Version version) |
| Modifier and Type | Method and Description |
|---|---|
int |
appendStructureData(ucar.nc2.Structure s,
ucar.ma2.StructureData sdata) |
void |
close() |
void |
create(java.lang.String filename,
ucar.nc2.NetcdfFile ncfile,
int extra,
long preallocateSize,
boolean largeFile) |
static void |
dumpbytes(byte[] bytes,
int start,
int len,
java.lang.String tag) |
void |
flush() |
static Nc4prototypes |
getCLibrary() |
java.lang.String |
getFileTypeDescription() |
java.lang.String |
getFileTypeId() |
static long |
getNativeAddr(int pos,
java.nio.ByteBuffer buf) |
static boolean |
isClibraryPresent()
Test if the netcdf C library is present and loaded
|
boolean |
isValidFile(ucar.unidata.io.RandomAccessFile raf)
Checks whether
raf is a valid file NetCDF-4 file. |
protected static java.lang.String |
nullify(java.lang.String s)
Convert a zero-length string to null
|
void |
open(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) |
void |
openForWriting(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask) |
ucar.ma2.Array |
readData(ucar.nc2.Variable v2,
ucar.ma2.Section section) |
boolean |
rewriteHeader(boolean largeFile) |
java.lang.Object |
sendIospMessage(java.lang.Object message) |
Nc4Iosp |
setAddReserved(boolean tf) |
void |
setChunker(ucar.nc2.write.Nc4Chunking chunker) |
static void |
setDebugFlags(ucar.nc2.util.DebugFlags flags) |
void |
setFill(boolean fill) |
static void |
setLibraryAndPath(java.lang.String jna_path,
java.lang.String lib_name)
set the path and name of the netcdf c library.
|
static java.lang.String |
show(SizeT[] inta) |
void |
updateAttribute(ucar.nc2.Variable v2,
ucar.nc2.Attribute att) |
static void |
useHdfEos(boolean val) |
void |
writeData(ucar.nc2.Variable v2,
ucar.ma2.Section section,
ucar.ma2.Array values) |
getDetailInfo, getFileTypeVersion, getLastModified, getStructureIterator, reacquire, readSection, readToByteChannel, readToOutputStream, release, streamToByteChannel, syncExtend, toStringDebugpublic static final boolean DEBUG
public static final java.lang.String JNA_PATH
public static final java.lang.String JNA_PATH_ENV
public static final java.lang.String TRANSLATECONTROL
public static final java.lang.String TRANSLATE_NONE
public static final java.lang.String TRANSLATE_NC4
public static final java.lang.String UCARTAGOPAQUE
public static final java.lang.String UCARTAGVLEN
public static final java.lang.String UCARTAGORIGTYPE
protected static java.lang.String DEFAULTNETCDF4LIBNAME
public Nc4Iosp()
public Nc4Iosp(ucar.nc2.NetcdfFileWriter.Version version)
public static void setLibraryAndPath(java.lang.String jna_path,
java.lang.String lib_name)
jna_path - path to shared librarieslib_name - library namepublic static boolean isClibraryPresent()
public static Nc4prototypes getCLibrary()
protected static java.lang.String nullify(java.lang.String s)
s - the string to check for lengthpublic static void useHdfEos(boolean val)
public static void setDebugFlags(ucar.nc2.util.DebugFlags flags)
public void setChunker(ucar.nc2.write.Nc4Chunking chunker)
public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf)
throws java.io.IOException
raf is a valid file NetCDF-4 file. Actually, it checks whether it is a valid HDF-5 file of
any type. Furthermore, it checks whether the NetCDF C library is available on the system. If both conditions are
satisfied, this method returns true; otherwise it returns false.isValidFile in interface ucar.nc2.iosp.IOServiceProviderraf - a file on disk.true if raf is a valid HDF-5 file and the NetCDF C library is available.java.io.IOException - if an I/O error occurs.public java.lang.String getFileTypeDescription()
getFileTypeDescription in interface ucar.nc2.iosp.IOServiceProviderpublic java.lang.String getFileTypeId()
getFileTypeId in interface ucar.nc2.iosp.IOServiceProviderpublic void close()
throws java.io.IOException
close in interface ucar.nc2.iosp.IOServiceProviderclose in class ucar.nc2.iosp.AbstractIOServiceProviderjava.io.IOExceptionpublic void open(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask)
throws java.io.IOException
open in interface ucar.nc2.iosp.IOServiceProvideropen in class ucar.nc2.iosp.AbstractIOServiceProviderjava.io.IOExceptionpublic void openForWriting(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask)
throws java.io.IOException
openForWriting in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionpublic static void dumpbytes(byte[] bytes,
int start,
int len,
java.lang.String tag)
public ucar.ma2.Array readData(ucar.nc2.Variable v2,
ucar.ma2.Section section)
throws java.io.IOException,
ucar.ma2.InvalidRangeException
readData in interface ucar.nc2.iosp.IOServiceProviderjava.io.IOExceptionucar.ma2.InvalidRangeExceptionpublic static java.lang.String show(SizeT[] inta)
public void create(java.lang.String filename,
ucar.nc2.NetcdfFile ncfile,
int extra,
long preallocateSize,
boolean largeFile)
throws java.io.IOException
create in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionpublic void writeData(ucar.nc2.Variable v2,
ucar.ma2.Section section,
ucar.ma2.Array values)
throws java.io.IOException,
ucar.ma2.InvalidRangeException
writeData in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionucar.ma2.InvalidRangeExceptionpublic int appendStructureData(ucar.nc2.Structure s,
ucar.ma2.StructureData sdata)
throws java.io.IOException,
ucar.ma2.InvalidRangeException
appendStructureData in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionucar.ma2.InvalidRangeExceptionpublic void flush()
throws java.io.IOException
flush in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionpublic Nc4Iosp setAddReserved(boolean tf)
public void setFill(boolean fill)
setFill in interface ucar.nc2.iosp.IOServiceProviderWriterpublic boolean rewriteHeader(boolean largeFile)
throws java.io.IOException
rewriteHeader in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionpublic void updateAttribute(ucar.nc2.Variable v2,
ucar.nc2.Attribute att)
throws java.io.IOException
updateAttribute in interface ucar.nc2.iosp.IOServiceProviderWriterjava.io.IOExceptionpublic static long getNativeAddr(int pos,
java.nio.ByteBuffer buf)
public java.lang.Object sendIospMessage(java.lang.Object message)
sendIospMessage in interface ucar.nc2.iosp.IOServiceProvidersendIospMessage in class ucar.nc2.iosp.AbstractIOServiceProvider