How to write newline character to file using bytes along with content

Hi 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

[597 byte] By [puneet_ka] at [2007-11-27 6:00:13]
# 1
what if you add: \r\n in the original string?
calvino_inda at 2007-7-12 16:38:05 > top of Java-index,Java Essentials,Java Programming...
# 2
ya \r\n worked. thanks. but whats the difference?Message was edited by: puneet_k
puneet_ka at 2007-7-12 16:38:05 > top of Java-index,Java Essentials,Java Programming...
# 3
not sure about it, but i was always told that "\r\n" meant "new line" on "lots of documents" whereas "\n" only or "\r" only were meaningless on some type of documents
calvino_inda at 2007-7-12 16:38:05 > top of Java-index,Java Essentials,Java Programming...