|
JTS Topology Suite version 1.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.io.WKBReader
public class WKBReader
Reads a Geometry
from a byte stream in Well-Known Binary format.
Supports use of an InStream
, which allows easy use
with arbitrary byte stream sources.
This class reads the format describe in WKBWriter
.
It also partially handles
the Extended WKB format used by PostGIS,
by parsing and storing SRID values.
The reader repairs structurally-invalid input
(specifically, LineStrings and LinearRings which contain
too few points have vertices added,
and non-closed rings are closed).
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.
for a formal format specification
Constructor Summary | |
---|---|
WKBReader()
|
|
WKBReader(GeometryFactory geometryFactory)
|
Method Summary | |
---|---|
static byte[] |
hexToBytes(java.lang.String hex)
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 is)
Reads a Geometry in binary WKB format from an InStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WKBReader()
public WKBReader(GeometryFactory geometryFactory)
Method Detail |
---|
public static byte[] hexToBytes(java.lang.String hex)
hex
- a string containing hex digits
public Geometry read(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-formedpublic Geometry read(InStream is) throws java.io.IOException, ParseException
Geometry
in binary WKB format from an InStream
.
is
- the stream to read from
java.io.IOException
- if the underlying stream creates an error
ParseException
- if the WKB is ill-formed
|
JTS Topology Suite version 1.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |