@Override
 public void visit(GeometryCollection geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   output.putUInt(geom.getNumGeometries());
 }
 @Override
 public <G extends Geometry<P>> void visit(GeometryCollection<P, G> geom) {
   writeByteOrder(output);
   writeTypeCodeAndSrid(geom, output);
   output.putUInt(geom.getNumGeometries());
 }