Class ShxWriter
java.lang.Object
ch.so.agi.gretl.internal.shapefile.core.ShxWriter
- All Implemented Interfaces:
AutoCloseable
Low-level writer for the
.shx index file.
The index shares the same 100-byte header layout as the .shp file. Each index entry is
8 bytes: the offset and content length, both big-endian and measured in 16-bit words. The offset
points at the start of the corresponding .shp record, including its 8-byte record header.
The FileChannel is owned by ShapefileDatasetWriter; close() therefore
does not close the channel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidwriteHeader(ShapefileHeader header) Writes (or patches) the 100-byte index header at the start of the file.voidwriteIndexEntry(long shpOffsetWords, int contentLengthWords) Appends a single 8-byte index entry at the current channel position.
-
Constructor Details
-
ShxWriter
-
-
Method Details
-
writeHeader
Writes (or patches) the 100-byte index header at the start of the file.- Throws:
IOExceptionShapefileMappingException
-
writeIndexEntry
public void writeIndexEntry(long shpOffsetWords, int contentLengthWords) throws IOException, ShapefileMappingException Appends a single 8-byte index entry at the current channel position.- Throws:
IOExceptionShapefileMappingException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-