aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/nio/DoubleBufferImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/nio/DoubleBufferImpl.java')
-rw-r--r--libjava/java/nio/DoubleBufferImpl.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/libjava/java/nio/DoubleBufferImpl.java b/libjava/java/nio/DoubleBufferImpl.java
index 504ee8d61b0..bad883c7d6c 100644
--- a/libjava/java/nio/DoubleBufferImpl.java
+++ b/libjava/java/nio/DoubleBufferImpl.java
@@ -1,5 +1,5 @@
/* DoubleBufferImpl.java --
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -80,6 +80,8 @@ final class DoubleBufferImpl extends DoubleBuffer
public DoubleBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class DoubleBufferImpl extends DoubleBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class DoubleBufferImpl extends DoubleBuffer
}
/**
- * Absolute put method. Writes <code>value</value> to position
+ * Absolute put method. Writes <code>value</code> to position
* <code>index</code> in the buffer.
*
* @exception IndexOutOfBoundsException If index is negative or not smaller