code: public static void writeGeometryCollection(ByteWriter writer,
  			GeometryCollection<?> geometryCollection) throws IOException {
  
  		writer.writeInt(geometryCollection.numGeometries());
  
  		for (Geometry geometry : geometryCollection.getGeometries()) {
  			writeGeometry(writer, geometry);
  		}
  	}
docs: Write a Geometry Collection
  
  @param writer
  @param geometryCollection
  @throws IOException