Please find the sample attached .
Thanks
Bhu1
-----Original Message-----
From: Bhuvan K Gupta [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 14, 2002 8:16 PM
To: JDJList
Subject: [jdjlist] Problem on HP-UX
Hi All,
Please see the attached program which simply creates a String from a
byte[] and prints it.
NOTE :: this byte[] is the byte representation of a EBCDIC String.
When I run this sample on Windows and Solaris. This works properly and
prints a String of junk chars as expected.
But when I run the same sample on HP-UX 11.11
It creates an EMPTY String object on new String(byte[]) and length is
also printed = 0
I have tried the following versions of both JDK and JRE on HP-UX
1.
java version "1.2.2.11"
HotSpot VM (1.0.1fcs, mixed mode, PA2.0 build
1.2.2.11-01/10/31-PA_RISC2.0)
2.
java version "1.3.1.02"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.3.1.02-011206-02:17)
Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.02-JPSE_1.3.1.02_20011206
PA2.0, mixed mode)
Any Clues !!!!
Thanks
Bhuvan
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
import poscopoc2.A;
/**
* <p>Title: POSCOPoc2</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: Winoble</p>
* @author unascribed
* @version 1.0
*/
public class Test {
public Test() throws Exception {
}
public static void main(String[] args) throws Exception {
Test test1 = new Test();
test1.test();
}
public void test()
{
byte[] Str = new byte[86];
Str[0] =-41;
Str[1] =-30;
Str[2] =-62;
Str[3] =-15;
Str[4] =-14;
Str[5] =64;
Str[6] =64;
Str[7] =64;
Str[8] =64;
Str[9] =64;
Str[10] =-15;
Str[11] =-15;
Str[12] =64;
Str[13] =-30;
Str[14] =-60;
Str[15] =-16;
Str[16] =-11;
Str[17] =-16;
Str[18] =-16;
Str[19] =-15;
Str[20] =64;
Str[21] =64;
Str[22] =64;
Str[23] =64;
Str[24] =64;
Str[25] =64;
Str[26] =-11;
Str[27] =-11;
Str[28] =-8;
Str[29] =-14;
Str[30] =-56;
Str[31] =64;
Str[32] =64;
Str[33] =64;
Str[34] =64;
Str[35] =64;
Str[36] =64;
Str[37] =64;
Str[38] =64;
Str[39] =64;
Str[40] =64;
Str[41] =64;
Str[42] =64;
Str[43] =-63;
Str[44] =-16;
Str[45] =-15;
Str[46] =-14;
Str[47] =-16;
Str[48] =-16;
Str[49] =-14;
Str[50] =-16;
Str[51] =-11;
Str[52] =-15;
Str[53] =-13;
Str[54] =-16;
Str[55] =-10;
Str[56] =-16;
Str[57] =-14;
Str[58] =-11;
Str[59] =-9;
Str[60] =-14;
Str[61] =-16;
Str[62] =-16;
Str[63] =-14;
Str[64] =-16;
Str[65] =-11;
Str[66] =-15;
Str[67] =-13;
Str[68] =-16;
Str[69] =-9;
Str[70] =-16;
Str[71] =-14;
Str[72] =-11;
Str[73] =-9;
Str[74] =-14;
Str[75] =-16;
Str[76] =-16;
Str[77] =-14;
Str[78] =-16;
Str[79] =-11;
Str[80] =-15;
Str[81] =-13;
Str[82] =-16;
Str[83] =-10;
Str[84] =-16;
Str[85] =-14;
String str = new String(Str);
System.out.println(" STr :: "+str);
}
}
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm