Possible bug with java.lang.String?

Bryce McKinlay bryce@waitaki.otago.ac.nz
Sat Aug 25 21:19:00 GMT 2001


Idan Sofer wrote:
>In J2SE 1.3 it worked just fine, however with gcj-3.0 exception was
>thrown, regarding corrupted header.
>>I have built a test class(attached), and it seems that:
>A) compression/decompression without conversion to String work great with
>gcj.
>B) When the compressed byte array is converted to String, some of the
>information get currupted, so it cannot be used for the decompression.
>Idan,
I tried your test case using a fairly recent cvs GCJ tree, and could not 
reproduce the problem. It is possible that this was a bug in GCJ 3.0 
that has been since fixed, or perhaps its a character encoding issue 
specific to your locale?
[bryce@kawarau test]$ gcj ziptest.java -o ziptest --main=ziptest
[bryce@kawarau test]$ ./ziptest
Compress/Decompress using byte arrays only:
Result: Hello World
Compress/Decompress using String as storage:
Source: Hello World
Byte array: xóHÍÉÉÏ/ÊI`w
 c|
Compressed: xóHÍÉÉÏ/ÊI`w
 c|
Result: Hello World
[bryce@kawarau test]$ java ziptest
Compress/Decompress using byte arrays only:
Result: Hello World
Compress/Decompress using String as storage:
Source: Hello World
Byte array: xóHÍÉÉÏ/ÊI`w
 c|
Compressed: xóHÍÉÉÏ/ÊI`w
 c|
Result: Hello World
regards
Bryce


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /