|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.postgis.binary.BinaryWriter
public class BinaryWriter
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).
Constructor Summary | |
---|---|
BinaryWriter()
|
Method Summary | |
---|---|
protected int |
estimateBytes(Geometry geom)
Estimate how much bytes a geometry will need in WKB. |
static ValueSetter |
valueSetterForEndian(ByteSetter bytes,
byte endian)
Get the appropriate ValueGetter for my endianness |
byte[] |
writeBinary(Geometry geom)
|
byte[] |
writeBinary(Geometry geom,
byte REP)
Write a binary encoded geometry. |
protected void |
writeGeometry(Geometry geom,
ValueSetter dest)
Parse a geometry starting at offset. |
java.lang.String |
writeHexed(Geometry geom)
|
java.lang.String |
writeHexed(Geometry geom,
byte REP)
Write a hex encoded geometry Is synchronized to protect offset counter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryWriter()
Method Detail |
---|
public static ValueSetter valueSetterForEndian(ByteSetter bytes, byte endian)
bytes
- The appropriate Byte Getter
public java.lang.String writeHexed(Geometry geom, byte REP)
the consistency checker
public java.lang.String writeHexed(Geometry geom)
public byte[] writeBinary(Geometry geom, byte REP)
Geometry.checkConsistency()
public byte[] writeBinary(Geometry geom)
protected void writeGeometry(Geometry geom, ValueSetter dest)
protected int estimateBytes(Geometry geom)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |