mirror of
https://github.com/ceph/ceph
synced 2025-02-19 00:47:49 +00:00
Hadoop: Fix a nasty IO bug.
CephInputStream.read() needs to return an int between 0 and 255, but bytes are signed and casting preserves that. Adjust if needed.
This commit is contained in:
parent
e9b00e09d2
commit
af72edd717
@ -114,7 +114,8 @@ class CephInputStream extends FSInputStream {
|
||||
byte result[] = new byte[1];
|
||||
if (getPos() >= fileLength) return -1;
|
||||
if (-1 == read(result, 0, 1)) return -1;
|
||||
return result[0];
|
||||
if (result[0]<0) return 256+(int)result[0];
|
||||
else return result[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user