Modified Read Procedure For An InputStream
Posted on 2008-02-05
I previously submitted a question that was excellently answered by CEHJ regarding reading bytes from an inputstream and writing them to a suitable buffer structure.
However I have one further modification I want to make namely the following:
The length of bytes I want to read from a file is unknown when I issue the request to read. The only known is that all the bytes must be read up to the start of of a sequence of 7 bytes.
Is it possible to modify your code above to do this. I have been looking at using the read method of an input stream that reads and returns a single byte at a time and then build the logic around iterations of this. Is there a smarter way to do this?