public class Nc4Iosp
extends ucar.nc2.iosp.AbstractIOServiceProvider
implements ucar.nc2.iosp.IOServiceProviderWriter
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
protected static String |
DEFAULTNETCDF4LIBNAME |
static String |
JNA_LOG_LEVEL |
static String |
JNA_PATH |
static String |
JNA_PATH_ENV |
static int |
NC_TURN_OFF_LOGGING |
static String |
TRANSLATE_NC4 |
static String |
TRANSLATE_NONE |
static String |
TRANSLATECONTROL |
static String |
UCARTAGOPAQUE |
static String |
UCARTAGORIGTYPE |
static 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(String filename,
ucar.nc2.NetcdfFile ncfile,
int extra,
long preallocateSize,
boolean largeFile) |
static void |
dumpbytes(byte[] bytes,
int start,
int len,
String tag) |
void |
flush() |
static Nc4prototypes |
getCLibrary() |
String |
getFileTypeDescription() |
String |
getFileTypeId() |
static long |
getNativeAddr(int pos,
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 String |
nullify(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) |
Object |
sendIospMessage(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(String jna_path,
String lib_name)
set the path and name of the netcdf c library.
|
static int |
setLogLevel(int level)
Set the log level for loaded library.
|
static 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 int NC_TURN_OFF_LOGGING
public static final String JNA_PATH
public static final String JNA_PATH_ENV
public static final String JNA_LOG_LEVEL
public static final String TRANSLATECONTROL
public static final String TRANSLATE_NONE
public static final String TRANSLATE_NC4
public static final String UCARTAGOPAQUE
public static final String UCARTAGVLEN
public static final String UCARTAGORIGTYPE
protected static String DEFAULTNETCDF4LIBNAME
public Nc4Iosp()
public Nc4Iosp(ucar.nc2.NetcdfFileWriter.Version version)
public static void setLibraryAndPath(String jna_path, String lib_name)
jna_path - path to shared librarieslib_name - library namepublic static boolean isClibraryPresent()
public static Nc4prototypes getCLibrary()
public static int setLogLevel(int level)
protected static String nullify(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 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.IOException - if an I/O error occurs.public String getFileTypeDescription()
getFileTypeDescription in interface ucar.nc2.iosp.IOServiceProviderpublic String getFileTypeId()
getFileTypeId in interface ucar.nc2.iosp.IOServiceProviderpublic void close()
throws IOException
close in interface ucar.nc2.iosp.IOServiceProviderclose in class ucar.nc2.iosp.AbstractIOServiceProviderIOExceptionpublic void open(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask)
throws IOException
open in interface ucar.nc2.iosp.IOServiceProvideropen in class ucar.nc2.iosp.AbstractIOServiceProviderIOExceptionpublic void openForWriting(ucar.unidata.io.RandomAccessFile raf,
ucar.nc2.NetcdfFile ncfile,
ucar.nc2.util.CancelTask cancelTask)
throws IOException
openForWriting in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionpublic static void dumpbytes(byte[] bytes,
int start,
int len,
String tag)
public ucar.ma2.Array readData(ucar.nc2.Variable v2,
ucar.ma2.Section section)
throws IOException,
ucar.ma2.InvalidRangeException
readData in interface ucar.nc2.iosp.IOServiceProviderIOExceptionucar.ma2.InvalidRangeExceptionpublic void create(String filename, ucar.nc2.NetcdfFile ncfile, int extra, long preallocateSize, boolean largeFile) throws IOException
create in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionpublic void writeData(ucar.nc2.Variable v2,
ucar.ma2.Section section,
ucar.ma2.Array values)
throws IOException,
ucar.ma2.InvalidRangeException
writeData in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionucar.ma2.InvalidRangeExceptionpublic int appendStructureData(ucar.nc2.Structure s,
ucar.ma2.StructureData sdata)
throws IOException,
ucar.ma2.InvalidRangeException
appendStructureData in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionucar.ma2.InvalidRangeExceptionpublic void flush()
throws IOException
flush in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionpublic Nc4Iosp setAddReserved(boolean tf)
public void setFill(boolean fill)
setFill in interface ucar.nc2.iosp.IOServiceProviderWriterpublic boolean rewriteHeader(boolean largeFile)
throws IOException
rewriteHeader in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionpublic void updateAttribute(ucar.nc2.Variable v2,
ucar.nc2.Attribute att)
throws IOException
updateAttribute in interface ucar.nc2.iosp.IOServiceProviderWriterIOExceptionpublic static long getNativeAddr(int pos,
ByteBuffer buf)