From da6dd8fba3fc4d582ad2bd3f59ff544963fa97b1 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Fri, 28 Sep 2007 13:18:28 -0600 Subject: [PATCH] Fix ByteBuffer bugs --- classpath/java/nio/ByteBuffer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classpath/java/nio/ByteBuffer.java b/classpath/java/nio/ByteBuffer.java index 4e2018ef77..dc32fac794 100644 --- a/classpath/java/nio/ByteBuffer.java +++ b/classpath/java/nio/ByteBuffer.java @@ -60,6 +60,7 @@ public class ByteBuffer { if (position != 0) { System.arraycopy(array, arrayOffset+position, array, arrayOffset, remaining()); } + position=0; return this; } @@ -74,7 +75,7 @@ public class ByteBuffer { } public ByteBuffer put(byte val) { - array[position++] = val; + array[arrayOffset+(position++)] = val; return this; }