writing to a file
I am randomly accessing a file and want to append text at the end of the file. I am trying following code.
I get exception at following like:
File file = new File("C:\\myFile.txt");
RandomAccessFile raf = new RandomAccessFile(file, "rw");
The method write(int) in the type RandomAccessFile is not applicable for the arguments (String)
Look in the Methods Summary section of the RandomAccessFile class api.
There are three write methods none of which take a String argument. Methods that take a String argument are writeBytes(String s) and writeUTF(String str).