public class N3iospWriter extends N3iosp implements IospFileWriter
header, lastModified, loglocation, ncfile, raf, rafOrder| Constructor and Description |
|---|
N3iospWriter() |
N3iospWriter(IOServiceProvider iosp) |
| Modifier and Type | Method and Description |
|---|---|
int |
appendStructureData(Structure s,
StructureData sdata)
Append a structureData along the unlimited dimension
|
void |
close()
Close the file.
|
NetcdfFile |
create(String filename,
Group.Builder rootGroup,
int extra,
long preallocateSize,
boolean largeFile)
Create new file, populate it from the objects in rootGroup.
|
void |
flush() |
NetcdfFile |
getOutputFile() |
void |
openForWriting(String location,
Group.Builder rootGroup,
CancelTask cancelTask)
Open existing file, populate rootGroup.
|
boolean |
rewriteHeader(boolean largeFile) |
void |
setFill(boolean fill)
Set the fill flag.
|
void |
updateAttribute(Group g,
Attribute att) |
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, getDetailInfo, getFileTypeDescription, getFileTypeId, getFileTypeVersion, isValidFile, reacquire, readArrayData, readData, sendIospMessage, toStringDebugbuildFinish, getLastModified, getStructureDataArrayIterator, getStructureIterator, open, readSection, readToOutputStream, release, setNetcdfFileclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildFinish, getLastModified, getStructureDataArrayIterator, getStructureIterator, readSection, readToOutputStream, releasepublic N3iospWriter()
public N3iospWriter(IOServiceProvider iosp)
public NetcdfFile create(String filename, Group.Builder rootGroup, int extra, long preallocateSize, boolean largeFile) throws IOException
IospFileWritercreate in interface IospFileWriterfilename - name of file to create.rootGroup - has the metadata of the file to be created. It is then modified, do not reuse.extra - if > 0, pad header with extra bytes (netcdf3 only).preallocateSize - if > 0, set length of file to this upon creation - this (usually) pre-allocates contiguous
storage.largeFile - if want large file format (netcdf3 only).IOExceptionpublic void openForWriting(String location, Group.Builder rootGroup, CancelTask cancelTask) throws IOException
IospFileWriteropenForWriting in interface IospFileWriterlocation - the existing filerootGroup - has the metadata of the file to be created. It is then modified, do not reuse.IOException - if I/O errorpublic NetcdfFile getOutputFile()
getOutputFile in interface IospFileWriterpublic void setFill(boolean fill)
IospFileWritersetFill in interface IospFileWriterfill - set fill mode true or falsepublic boolean rewriteHeader(boolean largeFile)
throws IOException
IOExceptionpublic void writeData(Variable v2, Section section, Array values) throws IOException, InvalidRangeException
IospFileWriterwriteData in interface IospFileWriterv2 - 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().IOException - if I/O errorInvalidRangeException - if invalid sectionpublic int appendStructureData(Structure s, StructureData sdata) throws IOException, InvalidRangeException
IospFileWriterappendStructureData in interface IospFileWriters - belongs to this structuresdata - the stuctureData to appendIOExceptionInvalidRangeExceptionpublic void updateAttribute(Variable v2, Attribute att) throws IOException
updateAttribute in interface IospFileWriterv2 - variable, or null for global attributeatt - replace with this valueIOExceptionpublic void updateAttribute(Group g, Attribute att) throws IOException
updateAttribute in interface IospFileWriterIOExceptionpublic void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOServiceProviderclose in interface Closeableclose in interface AutoCloseableclose in interface IOServiceProviderclose in class N3iospIOException - if read error