× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Neal:

What Thorbjørn wrote:

The println methods are located in the PrintStream/PrintWriter wrappers
(written from memory). If you need that functionality you pass the
stream as the argument to the PrintStream constructor and you have it.

lead me to ask: When the line oriented file output of Java on a System i is only for consumption by some PC program could the System property line.separator be changed to \r\n and get the result wanted with println() methods?

Something like:

String originalLineSeparator =
System.setProperty( "line.separator", "\r\n" );

Should work. See javadoc for PrintWriter.println(), they specifically state that the "line.separator" property is used to terminate the line.

I haven't tried it yet but I will. I have the same problem viewing my log4j logs written to the IFS and stdout redirected to IFS. On the PC I used Wordpad and on the System i WRKLNK option 5.

Bill Blalock

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Thorbjørn Ravn Andersen
Sent: Sunday, September 21, 2008 8:24 AM
To: Java Programming on and around the iSeries / AS400
Subject: Re: New line on FileStream

Neill Harper skrev:
Thanks Bill

That explains it, I guess it also explains why the Java Stream objects don't
have a writeline method?


The println methods are located in the PrintStream/PrintWriter wrappers
(written from memory). If you need that functionality you pass the
stream as the argument to the PrintStream constructor and you have it.

This makes for a very clean design, but it requires a lot of training
just to KNOW all the classes in the runtime.

--
Thorbjørn


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.