Question about RandomAccessFile and MappedByteBuffer
About RandomAccessFile's pointer.
Lets say I have 5 int values in a text file. I want to the 2nd int in my java program.
Then I jump 4 bytes forward (x.seek (4))(the pointer start at 0), because a int is equal to 4 byte.
If its a long value, I jump 8 byte forward, and so on for the rest of the primitive types.
But what about String, how do I do here? I dont get it....
MappedByteBuffer(mixed up with FileChannel and RandomAccessFile), this one is fast as hell when it comes to writing and reading to file. But I cant find any method that allow it to read/write strings. Am I out of options or is there an other way to do it?