diff options
author | Michael Koch <mkoch@gcc.gnu.org> | 2005-02-17 18:13:07 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-02-17 18:13:07 +0000 |
commit | 59fc63fcf808ba457739d34cf06fdf07272cc61f (patch) | |
tree | 30340632af1c19b009b5d7d71e927e0c3075b0ca /libjava/java/nio/ByteBufferImpl.java | |
parent | 856a4ce60e753491c4bbad2545c34ec63e69eae7 (diff) | |
download | gcc-59fc63fcf808ba457739d34cf06fdf07272cc61f.zip gcc-59fc63fcf808ba457739d34cf06fdf07272cc61f.tar.gz gcc-59fc63fcf808ba457739d34cf06fdf07272cc61f.tar.bz2 |
[multiple changes]
2005-02-17 Ito Kazumitsu <kaz@maczuka.gcd.org>
* java/nio/ByteBufferImpl.java (compact):
Set position and limit even if no bytes were moved.
2005-02-17 Michael Koch <konqueror@gmx.de>
* java/nio/CharViewBufferImpl.java (compact): Likewise.
* java/nio/DirectByteBufferImpl.java (compact): Likewise.
* java/nio/DoubleViewBufferImpl.java (compact): Likewise.
* java/nio/FloatViewBufferImpl.java (compact): Likewise.
* java/nio/IntViewBufferImpl.java (compact): Likewise.
* java/nio/LongViewBufferImpl.java (compact): Likewise.
* java/nio/MappedByteBufferImpl.java (compact): Likewise.
* java/nio/ShortViewBufferImpl.java (compact): Likewise.
* java/nio/FloatBufferImpl.java (compact): Set position.
* java/nio/CharBufferImpl.java (compact): Likewise.
* java/nio/DoubleBufferImpl.java (compact): Likewise.
* java/nio/IntBufferImpl.java (compact): Likewise.
* java/nio/LongBufferImpl.java (compact): Likewise.
* java/nio/ShortBufferImpl.java (compact): Likewise.
2005-02-17 Jeroen Frijters <jeroen@frijters.net>
* java/nio/ByteBufferImpl.java,
java/nio/CharBufferImpl.java,
java/nio/DirectByteBufferImpl.java,
java/nio/DoubleBufferImpl.java,
java/nio/FloatBufferImpl.java,
java/nio/IntBufferImpl.java,
java/nio/LongBufferImpl.java,
java/nio/MappedByteBufferImpl.java,
java/nio/ShortBufferImpl.java
(compact): Added explicit read-only check and invalidate mark.
From-SVN: r95176
Diffstat (limited to 'libjava/java/nio/ByteBufferImpl.java')
-rw-r--r-- | libjava/java/nio/ByteBufferImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libjava/java/nio/ByteBufferImpl.java b/libjava/java/nio/ByteBufferImpl.java index b1e6b1f..d9f2462 100644 --- a/libjava/java/nio/ByteBufferImpl.java +++ b/libjava/java/nio/ByteBufferImpl.java @@ -112,6 +112,8 @@ final class ByteBufferImpl extends ByteBuffer public ByteBuffer compact () { + checkIfReadOnly(); + mark = -1; int pos = position(); if (pos > 0) { @@ -120,6 +122,11 @@ final class ByteBufferImpl extends ByteBuffer position(count); limit(capacity()); } + else + { + position(limit()); + limit(capacity()); + } return this; } |