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