RandomAccessFile provides useful methods to read a file randomly.
I want to write some text at a random position in a file. Which class can provide the required functionality.Code:RandomAccessFile ref = new RandomAccessFile("abc.txt", "r");
Printable View
RandomAccessFile provides useful methods to read a file randomly.
I want to write some text at a random position in a file. Which class can provide the required functionality.Code:RandomAccessFile ref = new RandomAccessFile("abc.txt", "r");
The RandomAccessFile api has methods you can use to access and write to offsets within the file. For example, see getFilePointer, seek and writeUTF.