I am reading/writing/updating large data files and the RandomAccessFile() seems the best fit. The only problem is that using the primitive read member functions like readInt(), readFloat() etc takes too long.
It seems the read (byte[],int off, int len) function would help me with buffering my reads, but I'm still green under the collar when it comes to manipulating
Java primitive types.
I'm used to c where I can use memcpy to copy from a buffer into an int, or a float. How do I read in a block of bytes and then save it as the appropriate types? What is the equiv in Java for:
char buffer[20];
int ival;
float fval;
char cval;
memcpy (&ival, buffer, 4);
memcpy (&fval, &buffer[4], 4);
memcpy (&cval, &buffer[8], 1);
Many thanks.