Here is my problem: one big gzipped file; millions of posts.
Each message consists of:
***************** *************** ******************
* 2-byte LENGTH * * 1-byte TYPE * * N-byte PAYLOAD * , where N = (LENGTH-1).
***************** *************** ******************
Depending on TYPEme, I need to read a few bytes from the offset in PAYLOADand choose to accept or reject the message.
I know how to do this using java.io.DataInputStream, but it seems like the perfect java.nio.ByteBuffer application ( see here! ). However, I need help setting it up.
So, how can I use ByteBuffer to read messages from my gzipped file?
Update
I guess what I would like to see is a skeletal implementation of the code that could help me on the right track use ByteBuffer efficiently. Thank!