public Shape readJtsGeom(final DataInput dataInput) throws IOException {
JtsSpatialContext ctx = (JtsSpatialContext)super.ctx;
WKBReader reader = new WKBReader(ctx.getGeometryFactory());
try {
InStream inStream = new InStream() {//a strange JTS abstraction
boolean first = true;
@Override
public void read(byte[] buf) throws IOException {
if (first) {//we don't write JTS's leading BOM so synthesize reading it
if (buf.length != 1)