From 663e3ff353507696eb6161516bac435e92006192 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 30 Jan 2004 07:39:24 +0000 Subject: [PATCH] 2003/10/16 05:46:24 darcs-hash:20040130073924-aa32f-7eb779c2b50870239dd1caeaaa2da46dcd0e3f4f.gz --- src/org/xwt/util/CachedInputStream.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } -- 1.7.10.4