From 74e26c68b1b2180f9de08de2482ab996c2ee9437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Reiter?= Date: Sun, 11 May 2014 00:23:28 +0200 Subject: [PATCH] byte is a signed type in java, so we need to mask it with &0xFF, see http://stackoverflow.com/questions/11380062/what-does-value-0xff-do-in-java --- .../src/main/java/com/barchart/udt/net/NetInputStreamUDT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barchart-udt-core/src/main/java/com/barchart/udt/net/NetInputStreamUDT.java b/barchart-udt-core/src/main/java/com/barchart/udt/net/NetInputStreamUDT.java index f41b5c2..d403641 100644 --- a/barchart-udt-core/src/main/java/com/barchart/udt/net/NetInputStreamUDT.java +++ b/barchart-udt-core/src/main/java/com/barchart/udt/net/NetInputStreamUDT.java @@ -64,7 +64,7 @@ public int read() throws IOException { assert count == 1; - return data[0]; + return data[0] & 0xFF; }