Package org.geotools.data.sort
Class SimpleFeatureIO
- Object
-
- SimpleFeatureIO
-
public class SimpleFeatureIO extends Object
Allows writing and reading features to/from the given file- Author:
- Andrea Aime - GeoSolutions
-
-
Field Summary
Fields Modifier and Type Field Description static StringBIG_STRINGstatic StringENABLE_DESERIALIZATIONstatic intMAX_BYTES_LENGTH
-
Constructor Summary
Constructors Constructor Description SimpleFeatureIO(File file, SimpleFeatureType schema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(boolean deleteFile)Closes the IO, eventually deleting the file in the processbooleanendOfFile()Returns true if the end of file has been reachedlonggetOffset()Returns the current reading position in the fileSimpleFeatureread()Reads the next feature form the filevoidseek(long offset)Moves the IO to the specified offset in the fileStringtoString()voidwrite(SimpleFeature sf)Writes the feature to the file
-
-
-
Field Detail
-
MAX_BYTES_LENGTH
public static final int MAX_BYTES_LENGTH
- See Also:
- Constant Field Values
-
BIG_STRING
public static final String BIG_STRING
- See Also:
- Constant Field Values
-
ENABLE_DESERIALIZATION
public static final String ENABLE_DESERIALIZATION
- See Also:
- Constant Field Values
-
-
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 IOExceptionMoves the IO to the specified offset in the file- Throws:
IOException
-
getOffset
public long getOffset() throws IOExceptionReturns the current reading position in the file- Throws:
IOException
-
endOfFile
public boolean endOfFile() throws IOExceptionReturns true if the end of file has been reached- Throws:
IOException
-
close
public void close(boolean deleteFile) throws IOExceptionCloses the IO, eventually deleting the file in the process- Throws:
IOException
-
-