summaryrefslogtreecommitdiff
path: root/java/nio/FloatBufferImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/nio/FloatBufferImpl.java')
-rw-r--r--java/nio/FloatBufferImpl.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/java/nio/FloatBufferImpl.java b/java/nio/FloatBufferImpl.java
index b4868780c..f1182ba38 100644
--- a/java/nio/FloatBufferImpl.java
+++ b/java/nio/FloatBufferImpl.java
@@ -82,15 +82,14 @@ final class FloatBufferImpl extends FloatBuffer
{
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;
}