fix potential bug / negative bytes

This commit is contained in:
Shikhar Bhushan
2010-03-12 21:22:55 +01:00
parent 6581772c18
commit e6f2ed3035
2 changed files with 2 additions and 2 deletions

View File

@@ -109,7 +109,7 @@ public final class ChannelInputStream
public int read() public int read()
throws IOException { throws IOException {
synchronized (b) { synchronized (b) {
return read(b, 0, 1) == -1 ? -1 : b[0]; return read(b, 0, 1) == -1 ? -1 : b[0] & 0xff;
} }
} }

View File

@@ -171,7 +171,7 @@ public class RemoteFile
@Override @Override
public int read() public int read()
throws IOException { throws IOException {
return read(b, 0, 1) == -1 ? -1 : b[0]; return read(b, 0, 1) == -1 ? -1 : b[0] & 0xff;
} }
@Override @Override