In java.io.RandomAccessFile , when the method writeChar() is used to write a char array in loop to a Text file as
RandomAccessFile txtfile = new RandomAccessFile("Hello.txt","rw");
char c[] = {'S','i','g','n','e','d'};
for(char k:c) txtfile.writeChar(k);
Gives a Result in Hello.txt as when opened in normal notepad
S i g n e d
but , when opened with text Editor NotePad++ the Hello.txt is shown as
[NUL]S[NUL]i[NUL]g[NUL]n[NUL]e[NUL]d
and when i used writeUTF() method to write a String to Hello.txt as
txtfile.writeUTF("hello");
it given result as a blank space in front and when opened in NotePad++ it is showing as
[ENQ]hello
How i can write or append a Normal Line to file with out Spaces(like [NUL] or [ENQ] ) as in this case ?
please post answer how to write any String to a file in RandomAccessFile in Java !
Thanks in Advance !