sending ebcdic data
I am trying to send ebcdic data from a unix socket server to an os/390 client. I have tried encoding the data as "Cp1047" and then sending it byte at a time via an OutputStreamWriter created with the default encoding of UTF8. That didn't work. Then, in the following code snippet, I basically am doing the same thing, but also creating the OutputStreamWriter with the encoding parameter of "Cp1047". That failed as well, meaning unreadable data was received on the os/390 side.
Any help/pointers would be greatly appreciated.
Thanks.
Jeff
byte[] b=null;
String encoding ="Cp1047";
try{ b = data.getBytes(encoding);}
catch (UnsupportedEncodingException e){System.out.println("writeData() Encoding error => "+e);}
try
{
out =new OutputStreamWriter(connection.getOutputStream(), encoding);
for (int cntr = 0; cntr < b.length; cntr++)
{
out.write(b[cntr]);
}
out.flush();
}
catch (IOException e){System.out.println("writeData() Error writing to socket => "+e);}
}

