diff options
Diffstat (limited to 'libjava/classpath/java/nio/IntBufferImpl.java')
-rw-r--r-- | libjava/classpath/java/nio/IntBufferImpl.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libjava/classpath/java/nio/IntBufferImpl.java b/libjava/classpath/java/nio/IntBufferImpl.java index 22657482b42..2bd1842440e 100644 --- a/libjava/classpath/java/nio/IntBufferImpl.java +++ b/libjava/classpath/java/nio/IntBufferImpl.java @@ -82,15 +82,14 @@ final class IntBufferImpl extends IntBuffer { checkIfReadOnly(); mark = -1; - int copied = 0; - - while (remaining () > 0) + int p = position(); + int n = limit() - p; + if (n > 0) { - put (copied, get ()); - copied++; + System.arraycopy(backing_buffer, array_offset + p, + backing_buffer, array_offset, n); } - - position (copied); + position(n); limit(capacity()); return this; } |