[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
This commit is contained in:
Michael Koch 2005-02-17 18:13:07 +00:00
parent 856a4ce60e
commit 59fc63fcf8
16 changed files with 104 additions and 0 deletions

View File

@ -1,3 +1,38 @@
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.
2005-02-17 Michael Koch <konqueror@gmx.de>
* gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,

View File

@ -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;
}

View File

@ -87,6 +87,8 @@ final class CharBufferImpl extends CharBuffer
public CharBuffer compact ()
{
checkIfReadOnly();
mark = -1;
int copied = 0;
while (remaining () > 0)
@ -96,6 +98,7 @@ final class CharBufferImpl extends CharBuffer
}
position (copied);
limit(capacity());
return this;
}

View File

@ -122,6 +122,11 @@ class CharViewBufferImpl extends CharBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -197,6 +197,8 @@ abstract class DirectByteBufferImpl extends ByteBuffer
public ByteBuffer compact()
{
checkIfReadOnly();
mark = -1;
int pos = position();
if (pos > 0)
{
@ -205,6 +207,11 @@ abstract class DirectByteBufferImpl extends ByteBuffer
position(count);
limit(capacity());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -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;
}

View File

@ -120,6 +120,11 @@ final class DoubleViewBufferImpl extends DoubleBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -80,6 +80,8 @@ final class FloatBufferImpl extends FloatBuffer
public FloatBuffer compact ()
{
checkIfReadOnly();
mark = -1;
int copied = 0;
while (remaining () > 0)
@ -89,6 +91,7 @@ final class FloatBufferImpl extends FloatBuffer
}
position (copied);
limit(capacity());
return this;
}

View File

@ -120,6 +120,11 @@ final class FloatViewBufferImpl extends FloatBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -80,6 +80,8 @@ final class IntBufferImpl extends IntBuffer
public IntBuffer compact ()
{
checkIfReadOnly();
mark = -1;
int copied = 0;
while (remaining () > 0)
@ -89,6 +91,7 @@ final class IntBufferImpl extends IntBuffer
}
position (copied);
limit(capacity());
return this;
}

View File

@ -120,6 +120,11 @@ final class IntViewBufferImpl extends IntBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -80,6 +80,8 @@ final class LongBufferImpl extends LongBuffer
public LongBuffer compact ()
{
checkIfReadOnly();
mark = -1;
int copied = 0;
while (remaining () > 0)
@ -89,6 +91,7 @@ final class LongBufferImpl extends LongBuffer
}
position (copied);
limit(capacity());
return this;
}

View File

@ -120,6 +120,11 @@ final class LongViewBufferImpl extends LongBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -117,6 +117,8 @@ final class MappedByteBufferImpl extends MappedByteBuffer
public ByteBuffer compact()
{
checkIfReadOnly();
mark = -1;
int pos = position();
if (pos > 0)
{
@ -126,6 +128,11 @@ final class MappedByteBufferImpl extends MappedByteBuffer
position(count);
limit(capacity());
}
else
{
position(limit());
limit(capacity());
}
return this;
}

View File

@ -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;
}

View File

@ -120,6 +120,11 @@ final class ShortViewBufferImpl extends ShortBuffer
position (count);
limit (capacity ());
}
else
{
position(limit());
limit(capacity());
}
return this;
}