Look at the code below, if the high bit in the byte is set read returns a negitive number. The is clearly in violation of the specification which says the value must be between 0 - 255.
85 : public int read() 86 : throws IOException 87 : { 88 : byte[] buf = new byte[1]; 89 : int len = read(buf, 0, 1); 90 : if (len == -1) 91 : { 92 : return -1; 93 : } 94 : int ret = (int) buf[0]; 95 : if (ret < 0) 96 : { 97 : ret += 0x100; 98 : } 99 : return ret; 100 : } Lines 94-99 should be replaced with: return 0xff & buf[0]; -- Summary: ChunkedInputStream..read() returns incorrect values. Product: classpath Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P3 Component: classpath AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: daney at gcc dot gnu dot org GCC build triplet: *-*-* GCC host triplet: *-*-* GCC target triplet: *-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26312 _______________________________________________ Bug-classpath mailing list Bug-classpath@gnu.org http://lists.gnu.org/mailman/listinfo/bug-classpath