public interface ProductWriter
ProductReader
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all output streams currently open.
|
void |
deleteOutput()
Complete deletes the physical representation of the given product from the file system.
|
void |
flush()
Writes all data in memory to the data sink(s) associated with this writer.
|
Object |
getOutput()
Retrives the current output destination object.
|
ProductWriterPlugIn |
getWriterPlugIn()
Returns the plug-in which created this product writer.
|
boolean |
isIncrementalMode()
Returns whether this product writer writes only modified product nodes.
|
void |
removeBand(Band band)
Physically deletes a
Band in a product writer's output. |
void |
setFormatName(String formatName)
Sets selectable product format for writers which handle multiple formats.
|
void |
setIncrementalMode(boolean enabled)
Enables resp. disables incremental writing of this product writer.
|
boolean |
shouldWrite(ProductNode node)
Returns whether the given product node is to be written.
|
void |
writeBandRasterData(Band sourceBand,
int sourceOffsetX,
int sourceOffsetY,
int sourceWidth,
int sourceHeight,
ProductData sourceBuffer,
ProgressMonitor pm)
Writes raster data from the given in-memory source buffer into the data sink specified by the given source band
and region.
|
void |
writeProductNodes(Product product,
Object output)
Writes the in-memory representation of a data product.
|
ProductWriterPlugIn getWriterPlugIn()
null
Object getOutput()
null
if the
setOutput
has not been called so far.void writeProductNodes(Product product, Object output) throws IOException
Whether the band data - the actual pixel values - is written out immediately or later when pixels are flushed, is up to the implementation.
product
- the in-memory representation of the data productoutput
- an object representing a valid output for this writer, might be a ImageInputStream
or
other Object
to use for future decoding.IllegalArgumentException
- if output
is null
or it's type is not one of the
supported output sources.IOException
- if an I/O error occursvoid writeBandRasterData(Band sourceBand, int sourceOffsetX, int sourceOffsetY, int sourceWidth, int sourceHeight, ProductData sourceBuffer, ProgressMonitor pm) throws IOException
sourceOffsetX
and sourceOffsetY
of the source region. These parameters are an offset within the band's raster data
and not an offset within the source buffer.sourceWidth * sourceHeight
. The pixel values to be writte are considered to be stored in
line-by-line order, so the raster X co-ordinate varies faster than the Y.
sourceOffsetX
,
sourceOffsetY
, sourceWidth
and sourceHeight
parameters is given in the
source band's raster co-ordinates. These co-ordinates are identical with the destination raster co-ordinates
since product writers do not support spectral or spatial subsets.sourceBand
- the source band which identifies the data sink to which to write the sample valuessourceOffsetX
- the X-offset in the band's raster co-ordinatessourceOffsetY
- the Y-offset in the band's raster co-ordinatessourceWidth
- the width of region to be written given in the band's raster co-ordinatessourceHeight
- the height of region to be written given in the band's raster co-ordinatessourceBuffer
- the source buffer which provides the sample values to be writtenpm
- a monitor to inform the user about progressIOException
- if an I/O error occursIllegalArgumentException
- if the number of elements source buffer not equals sourceWidth *
sourceHeight
or the source region is out of the band's rasterAbstractBand.getRasterWidth()
,
AbstractBand.getRasterHeight()
void flush() throws IOException
IOException
- if an I/O error occursvoid close() throws IOException
flush
before
performing the actual close-operation.IOException
- if an I/O error occursboolean shouldWrite(ProductNode node)
node
- the product nodetrue
if soboolean isIncrementalMode()
true
if sovoid setIncrementalMode(boolean enabled)
enabled
- enables or disables progress listening.void deleteOutput() throws IOException
IOException
- if an I/O error occursvoid removeBand(Band band)
Band
in a product writer's output.band
- The band to delete.void setFormatName(String formatName)
formatName
- The name of the file format.Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.