Class 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 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​(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, or null
      • 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 interface AutoCloseable
        Throws:
        IOException - 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.