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 String
BIG_STRING
static String
ENABLE_DESERIALIZATION
static int
MAX_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 void
close(boolean deleteFile)
Closes the IO, eventually deleting the file in the processboolean
endOfFile()
Returns true if the end of file has been reachedlong
getOffset()
Returns the current reading position in the fileSimpleFeature
read()
Reads the next feature form the filevoid
seek(long offset)
Moves the IO to the specified offset in the fileString
toString()
void
write(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 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
-
-