I am using a dataoutput/datainputStream to make a binary Tree over a file,reading a 50000 lines .csv file to build it.
Initially i thought to achieve this with the RandomAccesFile class, but it has serious permormance issues (it's very slow on multiple read/write operations with small amounts of data). I achieved the seek performance when read using:
public void seek(long bytes) throws IOException{
this.dataInputStream.reset();
if(bytes>=0)
this.dataInputStream.skip(bytes);
}
Is possible to achieve write somewhere in the file using DataOutputStream, like RandomAccessFile does?.
Thank you for your support