I want to insert text into a file at a specific location without overwriting the existing text .
Is that possible and if yes , how?
I am currently using RandomAccessFile class to achieve my objective.The snippet used by me is as follows but it overwrites which i dont want
RandomAccessFile raf = new RandomAccessFile(fileName, "rw");
String fLine = raf.readLine();
if(fLine.startsWith("<?xml"))
{
raf.seek(fLine.length());
String st = "\n<ROWSET>\n";
byte buff[] = st.getBytes();
raf.write(buff);
raf.close();
}