writeHexedWithEndian method
Write a hex encoded geometry
Is to protect offset counter. (Unfortunately, Java does not have neither call by reference nor multiple return values.) This is a TODO item.
The geometry you put in must be consistent, geom.checkConsistency() must return true. If not, the result may be invalid WKB.
@see Geometry#checkConsistency() the consistency checker
@param geom the geometry to be written @param REP endianness to write the bytes with @return String containing the hex encoded geometry
Implementation
String writeHexedWithEndian(Geometry geom, int REP) {
int length = estimateBytes(geom);
StringByteSetter bytes = StringByteSetter(length);
writeGeometry(geom, valueSetterForEndian(bytes, REP));
return bytes.result();
}