aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/nio/ShortBufferImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/nio/ShortBufferImpl.java')
-rw-r--r--libjava/java/nio/ShortBufferImpl.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/libjava/java/nio/ShortBufferImpl.java b/libjava/java/nio/ShortBufferImpl.java
index 28f6efbd804..05424322b27 100644
--- a/libjava/java/nio/ShortBufferImpl.java
+++ b/libjava/java/nio/ShortBufferImpl.java
@@ -1,5 +1,5 @@
/* ShortBufferImpl.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 ShortBufferImpl extends ShortBuffer
public ShortBuffer compact ()
{
+ checkIfReadOnly();
+ mark = -1;
int copied = 0;
while (remaining () > 0)
@@ -89,6 +91,7 @@ final class ShortBufferImpl extends ShortBuffer
}
position (copied);
+ limit(capacity());
return this;
}
@@ -146,7 +149,7 @@ final class ShortBufferImpl extends ShortBuffer
}
/**
- * 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