× 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.



Thanks for the feedback guys.

All of our Java is going to run in a batch job with a pre-started JVM, I start the JVM from RPG so I think I could set the "line.separator" property on the properties string when starting the JVM.

Thanks

Neill

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

Blalock, Bill skrev:
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 guess so.

You can see the definition of the Java classes of the JVM in the src.zip
file in the /QIBM/ProdData/Java400/... folder (from memory). I just
checked the Sun Java 6 source and it is the value of the line.separator
property when the PrintStream is constructed that is used.

You might also be able just to put it in the SystemDefault.properties
file in your home directory and have Java pick it up automatically if
you always need this.

/Thorbjørn

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.