Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferOutputStream.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferOutputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferOutputStream.java
index 6b277ddf45..961cabb5a6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferOutputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferOutputStream.java
@@ -98,6 +98,10 @@ public class BufferOutputStream extends OutputStream
flushIfFilled();
ensureBuffer();
+ // If this was called with a primitive byte with a negative value,
+ // the implicit conversion prepended 24 leading 1's. We'll undo those.
+ b = b & 0xFF;
+
if (TRACER.isEnabled())
{
TRACER.trace("--> " + HexUtil.formatByte(b) //$NON-NLS-1$

Back to the top