Hi,
I have approx. 30000 files (1MB each) which I want to put into a native method, which requires just an byte array and the size of it as arguments.
I looked through some examples and benchmarks (like http://nadeausoftware.com/articles/2008/02/java_tip_how_read_files_quickly) but all of them do some other fancy things.
Basically I don't care about the contents of the file, I don't want to access something in that file or the byte array or do anything else with it. I just want to put a file into a native method which accepts an byte array as fast as possible.
At the moment I'm using RandomAccessFile, but that's horribly slow (10MB/s).
Is there anything like
byte[] readTheWholeFile(File file){ ... }
which I could put into
native void fancyCMethod(readTheWholeFile(myFile), myFile.length())
What would you suggest?