|
Yep, sort of. In your case - cross platform - it's only because a
certain method in IFSTextFileInputStream does it for you.
Or doesn't do, in this case.
I wouldn't be surprised at all, in fact I would expect, that the
"properties" file doesn't load properly even using Java on the AS/400.
If it does, it's a convenience IBM decided to supply.
Using the IFSFileInputStream probably won't work running
on the 400 (without my modification) ... but I do know that using
a normal FileInputStream does work on the 400. I use it all the
time.
From another mail:
Oddly enough, when Properties loads the InputStream ...
it creates a reader internally. You would think there
should be a way to load properties passing in a Reader
instead of an InputStream.
Joe Sam Shirah wrote:
This is what I assumed the IFSTextFileInputStream class would do.
Reading
from a text file in Java should convert from >EBCDIC to Unicode
automatically.
Yep, sort of. In your case - cross platform - it's only because a
certain method in IFSTextFileInputStream does it for you.
Or doesn't do, in this case.
I'm 95% sure it DOES do that ... but I just can't figure out what I'm
doing wrong.
You're making some invalid assumptions.
True ... the assumption was that the code worked. The problem was that
there is clearly a bug in the IFSTextFileInputStream class.
After a bit of digging I was able to correct problem and will be
submitting a correction to the JT400 project.
I added the following method to IFSTextFileInputStream ...
----------
public int read(byte[] b) throws IOException {
String input = read(b.
byte[] inputBytes = input.getBytes();
int inputLength = input.length();
System.arraycopy(inputBytes, 0, b, 0, inputLength);
return inputLength;
}
----------
I wouldn't be surprised at all, in fact I would expect, that the
"properties" file doesn't load properly even using Java on the AS/400.
If
it does, it's a convenience IBM decided to supply.
Using the IFSFileInputStream probably won't work running on the 400
(without my modification) ... but I do know that using a normal
FileInputStream does work on the 400. I use it all the time.
david
As an Amazon Associate we earn from qualifying purchases.
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.