Class BinaryParser
- java.lang.Object
-
- io.github.sebasbaumh.postgis.binary.BinaryParser
-
public final class BinaryParser extends Object
Parse binary representation of geometries. It should be easy to add char[] and CharSequence ByteGetter instances, although the latter one is not compatible with older jdks. I did not implement real unsigned 32-bit integers or emulate them with long, as both java Arrays and Strings currently can have only 2^31-1 elements (bytes), so we cannot even get or build Geometries with more than approx. 2^28 coordinates (8 bytes each).- Author:
- Markus Schaber <[email protected]>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Geometry
parse(byte[] value, int offset)
Parse a hex encoded geometrystatic Geometry
parse(String value)
Parse a hex encoded geometry
-
-
-
Method Detail
-
parse
public static Geometry parse(byte[] value, int offset)
Parse a hex encoded geometry- Parameters:
value
- byte array containing the data to be parsedoffset
- offset- Returns:
- resulting geometry for the parsed data
- Throws:
IllegalArgumentException
- if a contained geometry is of the wrong type or the encoding type is unknown
-
parse
public static Geometry parse(String value)
Parse a hex encoded geometry- Parameters:
value
- String containing the data to be parsed- Returns:
- resulting geometry for the parsed data
- Throws:
IllegalArgumentException
- if a contained geometry is of the wrong type or the encoding type is unknown
-
-