writing to text file using randomaccessfile
807580Jan 20 2010 — edited Jan 20 2010I am using RandomAccessFile to write String into text file
RandomAccessFile output = new RandomAccessFile("C:/FaultObject1.java", "rw");
byte[] stringAsBytes = line.getBytes("UTF-16");
output.write(stringAsBytes);
where line is String. It is not able to write spaces, like I have some lines which doesn't have text but just empty lines and I do want it
to put it the same way. Is there any way?