smurn/jPLY — Issue #23: New API concept
Author: smurn
Created: 2011-12-18 22:32:19+00:00
State: open

Currently a PlyReader 'reads' ElementReaders with read Elements. While this makes sense its not very elegant.

I like the way [ZipInputStream](http://docs.oracle.com/javase/1.4.2/docs/api/java/util/zip/ZipInputStream.html) handles the same situation (a zip file contains mutliple zipped files).

This could look like this:

PlyReader.getNextElementType()

will advance the internal pointer to the first element of the next type. Those can then be read with

PlyReader.readElement()

which will return null at the end of the type even if the end of the file has not yet been reached.

This would avoid the `ElementReader`s and the problematic that they need to be closed first. One file represents one stream and one stream should only be represented by one class.