Package de.javagl.ply
Interface PlyReader
-
public interface PlyReaderInterface for classes that can read PLY data
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PlySourceread(InputStream inputStream)Read the data from the given input stream and return it as aPlySourceThe caller is responsible for closing the given stream.voidreadContent(InputStream inputStream, PlyTarget plyTarget)Read the main content from the given input stream and pass it to the givenPlyTarget.DescriptorreadDescriptor(InputStream inputStream)Read theDescriptorfrom the given input stream.
-
-
-
Method Detail
-
read
PlySource read(InputStream inputStream) throws IOException
Read the data from the given input stream and return it as aPlySourceThe caller is responsible for closing the given stream.- Parameters:
inputStream- The input stream- Returns:
- The resulting data as a
PlySource - Throws:
IOException- If an IO error occurs
-
readDescriptor
Descriptor readDescriptor(InputStream inputStream) throws IOException
Read theDescriptorfrom the given input stream. This will read the stream, byte by byte, until the header is complete and theDescriptorcan be returned. The caller will usually not close the input stream after this method returns. Instead, the caller will pass the remaining stream toreadContent(InputStream, PlyTarget)and close the input stream afterwards.- Parameters:
inputStream- The input stream- Returns:
- The
Descriptor - Throws:
IOException- If an IO error occurs
-
readContent
void readContent(InputStream inputStream, PlyTarget plyTarget) throws IOException
Read the main content from the given input stream and pass it to the givenPlyTarget. This assumes that theDescriptorwas already read from the given input stream, and the stream only contains the remaining data. The caller is responsible for closing the given stream.- Parameters:
inputStream- The input streamplyTarget- ThePlyTarget- Throws:
IOException- If an IO error occurs
-
-