From: brian Date: Fri, 30 Jan 2004 07:39:24 +0000 (+0000) Subject: 2003/10/16 05:46:24 X-Git-Tag: RC3~473 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=663e3ff353507696eb6161516bac435e92006192;p=org.ibex.core.git 2003/10/16 05:46:24 darcs-hash:20040130073924-aa32f-7eb779c2b50870239dd1caeaaa2da46dcd0e3f4f.gz --- diff --git a/src/org/xwt/util/CachedInputStream.java b/src/org/xwt/util/CachedInputStream.java index 1c2cffd..fdf8a78 100644 --- a/src/org/xwt/util/CachedInputStream.java +++ b/src/org/xwt/util/CachedInputStream.java @@ -41,7 +41,7 @@ public class CachedInputStream { public int read() throws IOException { // FEATURE: be smarter here byte[] b = new byte[1]; int ret = read(b, 0, 1); - return ret == -1 ? -1 : b[0]; + return ret == -1 ? -1 : b[0]&0xff; } public int read(byte[] b, int off, int len) throws IOException { synchronized(CachedInputStream.this) { @@ -49,6 +49,7 @@ public class CachedInputStream { if (eof && pos == size) return -1; int count = Math.min(size - pos, len); System.arraycopy(cache, pos, b, off, count); + pos += count; return count; } }