Skip to content

Commit cf06241

Browse files
committed
https://github.com/EsotericSoftware/kryo/issues/337
Fix issue where ByteBufferInputStream violates the InputStream contract.
1 parent c890060 commit cf06241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/esotericsoftware/kryo/io/ByteBufferInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void setByteBuffer (ByteBuffer byteBuffer) {
5252

5353
public int read () throws IOException {
5454
if (!byteBuffer.hasRemaining()) return -1;
55-
return byteBuffer.get();
55+
return byteBuffer.get() & 0xFF;
5656
}
5757

5858
public int read (byte[] bytes, int offset, int length) throws IOException {

0 commit comments

Comments
 (0)