code: public static void writePolygon(ByteWriter writer, Polygon polygon)
  			throws IOException {
  
  		writer.writeInt(polygon.numRings());
  
  		for (LineString ring : polygon.getRings()) {
  			writeLineString(writer, ring);
  		}
  	}
docs: Write a Polygon
  
  @param writer
  @param polygon
  @throws IOException