How to write newline character to file using bytes along with content
807600May 31 2007 — edited May 31 2007Hi All,
I need to write headers into the file using byte[]. I am creating the strings of header which will form the different rows in the file. I am new to java and would like to know how to embed new line character so that when the byte[] is written to file headers come in different rows.
like
hrd1:abcd
hdr2:1234
when i embed \n and \r in string and do getBytes() and write it to file, some boxes are written in the file and everything comes into single line.
Please advice me the correct way .
Thanks in advance.
Cheers!!
Puneet