satellite03
IS-IT--Management
Code:
import java.io.*;
class RAFtest
{
public static void main(String args[]) throws IOException
{
RandomAccessFile f = new RandomAccessFile("c:\\abc.txt","rw");
BufferedReader abc = new BufferedReader(new FileReader("c:\\def.txt"));
String s = abc.readLine();
f.writeChars(s);
}
}
def.txt
_______
abcd
output in abc.txt
__________________
a b c d // note the gaps in between chars
why there are gaps ? if i usued writeBytes() there would have been no gaps.
how those gaps have been created in the output?