Reading a fle format thats part ascii and part binary
Hey
I'm trying to write a importer for the PLY filke format. That file format starts of with a header in ascii and then continues with either the data in ascii or in binary. When the data is in ascii I have no problem reading the file but when the data is in binary I'm noth quite sure how I should do it. Right now I do something like this:
BufferedInputStream stream =new BufferedInputStream(new FileInputStream(file));// I first create this
BufferedReader reader =new BufferedReader(new InputStreamReader(stream));// then this is for reader ascii
DataInputStream dataInputStream =new DataInputStream(stream);// And this is for reading binary
Then I read the ascii header with the BuffereReader and then wheter I turns out that the data is in ascii I countine reading with the reader, otherwise I start reading with the DataInputStream. But the data from the DataInputStream is not the same as I get from the BufferedReader. I try it on these files that are in diffrent endians and either ascii ot binary
http://www.cs.ucl.ac.uk/staff/Joao.Oliveira/ply.html in the Nbunny.zip.
Anyone that can help me with this? Or know about a PLY file reader in java already?
Discordia
Message was edited by:
Discordia

