For some reasons, if this class is instantiate from RPG program, it
works correctly (Str variable will contain readable context). But if
this class is instantiate from a EJB application, that is running on an
iseries, the str variable will contain non-readable text. It is
obviously caused by bao is in EBCDIC format when running in RPG but it
is in ASCII format when running from EJB.
Any idea how I can resolve this issue?
Below is the complete code of the class:
package com.arch.boss.util;
StreamGobbler(InputStream is, List<String> listString)
{
this.is = is;
this.bao = new ByteArrayOutputStream();
this.listString = listString;
}
public void run()
{
try {
// read the inputStream and place the result in the
outputStream
int result = is.read();
while(result != -1) {
byte b = (byte)result;
bao.write(b);
result = is.read();
}
is.close();
// if caller wants it in List String format, convert
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.