Contrary to your claim, your code clearly isn't writing "\r\n" after each line. It's calling BufferedWriter.newLine()
which uses the current platform's default line separator (unless you explicitly set the line.separator
system property). On Unix systems this will be "\n".
Now, you need to think about what you want the result to be on the target systems where it will be read. For Windows, that means you should explicitly write "\r\n"... I don't know about the mainframes you mention though - you'd need to give more details.
Note that the fact that there are different line separators available means that no one text file will be universally suitable. Many text editors on different platforms cope with any line separator... but there will always be some that don't :(