public class N3iospWriter extends N3iospNew implements IOServiceProviderWriter
IOServiceProvider.SortGroupheader, lastModified, loglocation, ncfile, raf, rafOrder| Constructor and Description |
|---|
N3iospWriter(IOServiceProvider iosp) |
| Modifier and Type | Method and Description |
|---|---|
int |
appendStructureData(Structure s,
StructureData sdata)
Append a structureData along the unlimited dimension
|
void |
create(java.lang.String filename,
NetcdfFile ncfile,
int extra,
long preallocateSize,
boolean largeFile)
Create new file, populate it from the objects in ncfile.
|
void |
flush()
Flush all data buffers to disk.
|
void |
openForWriting(RandomAccessFile raf,
NetcdfFile ncfile,
CancelTask cancelTask)
Open existing file and allow writing.
|
boolean |
rewriteHeader(boolean largeFile)
if theres room before data, rewrite header without moving the data.
|
void |
setFill(boolean fill)
Set the fill flag.
|
boolean |
syncExtend()
Extend the NetcdfFile if the underlying dataset has changed
in a way that is compatible with the current metadata.
|
void |
updateAttribute(Variable v2,
Attribute att)
Update the value of an existing attribute on disk, not in memory.
|
void |
writeData(Variable v2,
Section section,
Array values)
Write data into a variable.
|
build, close, getDetailInfo, getFileTypeDescription, getFileTypeId, getFileTypeVersion, isBuilder, isValidFile, open, reacquire, readData, readToByteChannel, sendIospMessage, toStringDebugbuildFinish, getLastModified, getStructureIterator, readSection, readToOutputStream, release, setNetcdfFile, streamToByteChannelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuild, buildFinish, close, compareTo, getDetailInfo, getFileTypeDescription, getFileTypeId, getFileTypeVersion, getSortGroup, getStructureIterator, isBuilder, isValidFile, open, reacquire, readData, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, streamToByteChannel, toStringDebugpublic N3iospWriter(IOServiceProvider iosp)
public void openForWriting(RandomAccessFile raf, NetcdfFile ncfile, CancelTask cancelTask) throws java.io.IOException
IOServiceProviderWriteropenForWriting in interface IOServiceProviderWriterraf - the file to work on.ncfile - add objects to this empty NetcdfFilecancelTask - used to monitor user cancellation; may be null.java.io.IOException - if I/O errorpublic void setFill(boolean fill)
IOServiceProviderWritersetFill in interface IOServiceProviderWriterfill - set fill mode true or falsepublic void create(java.lang.String filename,
NetcdfFile ncfile,
int extra,
long preallocateSize,
boolean largeFile)
throws java.io.IOException
IOServiceProviderWritercreate in interface IOServiceProviderWriterfilename - name of file to create.ncfile - get everything but data from hereextra - if > 0, pad header with extra bytespreallocateSize - if > 0, set length of file to this upon creation - this (usually) pre-allocates contiguous
storage.largeFile - if want large file formatjava.io.IOException - if I/O errorpublic boolean rewriteHeader(boolean largeFile)
throws java.io.IOException
IOServiceProviderWriterrewriteHeader in interface IOServiceProviderWriterjava.io.IOExceptionpublic void writeData(Variable v2, Section section, Array values) throws java.io.IOException, InvalidRangeException
IOServiceProviderWriterwriteData in interface IOServiceProviderWriterv2 - variable to write; must already exist.section - the section of data to write.
There must be a Range for each Dimension in the variable, in order.
The shape must match the shape of values.
The origin and stride indicate where the data is placed into the stored Variable array.values - data to write. The shape must match section.getShape().java.io.IOException - if I/O errorInvalidRangeException - if invalid sectionpublic int appendStructureData(Structure s, StructureData sdata) throws java.io.IOException, InvalidRangeException
IOServiceProviderWriterappendStructureData in interface IOServiceProviderWriters - belongs to this structuresdata - the stuctureData to appendjava.io.IOExceptionInvalidRangeExceptionpublic void updateAttribute(Variable v2, Attribute att) throws java.io.IOException
updateAttribute in interface IOServiceProviderWriterv2 - variable, or null for global attributeatt - replace with this valuejava.io.IOExceptionpublic void flush()
throws java.io.IOException
IOServiceProviderWriterflush in interface IOServiceProviderWriterflush in class N3iospNewjava.io.IOExceptionpublic boolean syncExtend()
throws java.io.IOException
IOServiceProvidersyncExtend in interface IOServiceProvidersyncExtend in class N3iospNewjava.io.IOException - if a read error occured when accessing the underlying dataset.