public class WKBReader extends Object
Geometryfrom a byte stream in Well-Known Binary format. Supports use of an
InStream, which allows easy use with arbitary byte stream sources.
This class reads the format describe in WKBWriter. It also partiually handles the Extended WKB format used by PostGIS, by parsing and storing SRID values.
This class is designed to support reuse of a single instance to read multiple geometries. This class is not thread-safe; each thread should create its own instance.
WKBWriter
| Constructor and Description |
|---|
WKBReader()
|
WKBReader(GeometryFactory
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
hexToBytes(String
Converts a hexadecimal string to a byte array.
|
Geometry |
read(byte[] bytes)
Reads a single
Geometry in WKB format from a byte array.
|
Geometry |
read(InStream
Reads a
Geometry in binary WKB format from an {@link InStream).
|
public WKBReader()
public WKBReader(GeometryFactorygeometryFactory)
public static byte[] hexToBytes(Stringhex)
hex - a string containing hex digits
public Geometryread(byte[] bytes) throws ParseException
Geometry in WKB format from a byte array.
bytes - the byte array to read from
ParseException - if the WKB is ill-formed
public Geometryread(InStream is) throws IOException , ParseException
Geometry in binary WKB format from an {@link InStream).
is - the stream to read from
IOException - if the underlying stream creates an error
ParseException - if the WKB is ill-formed