This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Possible bug with java.lang.String?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]