Class BinaryWriter
- java.lang.Object
-
- io.github.sebasbaumh.postgis.binary.BinaryWriter
-
public class BinaryWriter extends java.lang.Object
Create binary representation of geometries. Currently, only text rep (hexed) implementation is tested. 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:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description BinaryWriter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
writeGeometry(Geometry geom, ValueSetter dest)
Parse a geometry starting at offset.static java.lang.String
writeHexed(Geometry geom)
Write a hex encoded geometry The geometry you put in must be consistent, geom.checkConsistency() must return true.
-
-
-
Method Detail
-
writeGeometry
protected static void writeGeometry(Geometry geom, ValueSetter dest)
Parse a geometry starting at offset.- Parameters:
geom
- the geometry to writedest
- the value setting to be used for writing
-
writeHexed
public static java.lang.String writeHexed(Geometry geom)
Write a hex encoded geometry The geometry you put in must be consistent, geom.checkConsistency() must return true. If not, the result may be invalid WKB.- Parameters:
geom
- the geometry to be written- Returns:
- String containing the hex encoded geometry
- See Also:
the consistency checker
-
-