Class SimpleFeatureIO


  • public class SimpleFeatureIO
    extends Object
    Allows writing and reading features to/from the given file
    Author:
    Andrea Aime - GeoSolutions
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close​(boolean deleteFile)
      Closes the IO, eventually deleting the file in the process
      boolean endOfFile()
      Returns true if the end of file has been reached
      long getOffset()
      Returns the current reading position in the file
      SimpleFeature read()
      Reads the next feature form the file
      void seek​(long offset)
      Moves the IO to the specified offset in the file
      String toString()  
      void write​(SimpleFeature sf)
      Writes the feature to the file
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleFeatureIO

        public SimpleFeatureIO​(File file,
                               SimpleFeatureType schema)
                        throws FileNotFoundException
        Throws:
        FileNotFoundException
    • Method Detail

      • write

        public void write​(SimpleFeature sf)
                   throws IOException
        Writes the feature to the file
        Throws:
        IOException
      • read

        public SimpleFeature read()
                           throws IOException
        Reads the next feature form the file
        Throws:
        IOException
      • seek

        public void seek​(long offset)
                  throws IOException
        Moves the IO to the specified offset in the file
        Throws:
        IOException
      • getOffset

        public long getOffset()
                       throws IOException
        Returns the current reading position in the file
        Throws:
        IOException
      • endOfFile

        public boolean endOfFile()
                          throws IOException
        Returns true if the end of file has been reached
        Throws:
        IOException
      • close

        public void close​(boolean deleteFile)
                   throws IOException
        Closes the IO, eventually deleting the file in the process
        Throws:
        IOException
      • toString

        public String toString()
        Overrides:
        toString in class Object