Package org.arakhne.afc.gis.io.binary
Class GISLayerWriter
- java.lang.Object
-
- org.arakhne.afc.gis.io.binary.GISLayerWriter
-
- All Implemented Interfaces:
AutoCloseable
public class GISLayerWriter extends Object implements AutoCloseable
Writer of GIS elements in a Java serialized form.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:54
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisinputoutput
-
-
Constructor Summary
Constructors Constructor Description GISLayerWriter(File filename)
Constructs a GIS writer.GISLayerWriter(OutputStream stream)
Constructs a GIS writer.GISLayerWriter(URL url)
Constructs a GIS writer.GISLayerWriter(WritableByteChannel channel)
Constructs a GIS writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Flush temp buffers, write down final information in file header (file size...), and close the streams.Progression
getProgression()
Replies the task progression.void
setProgression(Progression progressBar)
Set the task progression associated to this writer.void
write(Collection<? extends MapLayer> layers)
Write the given layers into the output.void
write(MapLayer layer)
Write the given layer into the output.protected void
writeHeader()
Write the header of the file.
-
-
-
Constructor Detail
-
GISLayerWriter
public GISLayerWriter(File filename) throws IOException
Constructs a GIS writer.- Parameters:
filename
- is the file to write- Throws:
IOException
- in case of error.
-
GISLayerWriter
public GISLayerWriter(URL url) throws IOException
Constructs a GIS writer.- Parameters:
url
- is the URL of the file to write- Throws:
IOException
- in case of error.
-
GISLayerWriter
public GISLayerWriter(WritableByteChannel channel) throws IOException
Constructs a GIS writer.- Parameters:
channel
- is the file to write- Throws:
IOException
- in case of error.
-
GISLayerWriter
public GISLayerWriter(OutputStream stream) throws IOException
Constructs a GIS writer.- Parameters:
stream
- is is the stream to write- Throws:
IOException
- in case of error.
-
-
Method Detail
-
getProgression
@Pure public Progression getProgression()
Replies the task progression.- Returns:
- the task progression object associated to this writer, or
null
-
setProgression
public void setProgression(Progression progressBar)
Set the task progression associated to this writer.- Parameters:
progressBar
- is the task progression object associated to this writer, ornull
-
close
public void close() throws IOException
Flush temp buffers, write down final information in file header (file size...), and close the streams.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- in case of error.
-
write
public final void write(MapLayer layer) throws IOException
Write the given layer into the output.- Parameters:
layer
- is the layer to write down.- Throws:
IOException
- in case of error.IndexOutOfBoundsException
- in case of error.
-
write
public void write(Collection<? extends MapLayer> layers) throws IOException
Write the given layers into the output.- Parameters:
layers
- are the layers to write.- Throws:
IOException
- in case of error.
-
writeHeader
protected void writeHeader() throws IOException
Write the header of the file.- Throws:
IOException
- in case of error.
-
-