I have a huge file to be read. I have a IO thread which reads data ( 4mb ) from the disk and stores in a circular array of 6 elements ( 4mb each ). I have another thread which reads from the circular buffer to convert the data into a some records.
The problem is I can have records which spans across 2 different buffers ( ie. say a record can start from the end of 1st buffer and extend upto start of next buffer )
How do I handle such cases ?
Could you point to some sample implementation ?