code: public static void writePolyhedralSurface(ByteWriter writer,
  			PolyhedralSurface polyhedralSurface) throws IOException {
  
  		writer.writeInt(polyhedralSurface.numPolygons());
  
  		for (Polygon polygon : polyhedralSurface.getPolygons()) {
  			writeGeometry(writer, polygon);
  		}
  	}
docs: Write a Polyhedral Surface
  
  @param writer
  @param polyhedralSurface
  @throws IOException