code: private static void fillIndexBuffer(
              ElementReader reader,
              IntBuffer indexBuffer) throws IOException {
  
          // Just go though the triangles and store the indices in the buffer.
          Element triangle = reader.readElement();
          while (triangle != null) {
  
              int[] indices = triangle.getIntList("vertex_index");
              for (int index : indices) {
                  indexBuffer.put(index);
              }
  
              triangle = reader.readElement();
          }
      }
docs: Fill the index buffer with the data from the PLY file.