code: public static Triangle readTriangle(ByteReader reader, boolean hasZ,
  			boolean hasM) {
  
  		Triangle triangle = new Triangle(hasZ, hasM);
  
  		int numRings = reader.readInt();
  
  		for (int i = 0; i < numRings; i++) {
  			LineString ring = readLineString(reader, hasZ, hasM);
  			triangle.addRing(ring);
  
  		}
  
  		return triangle;
  	}
docs: Read a Triangle
  
  @param reader
  @param hasZ
  @param hasM
  @return triangle