diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7c54d610be9728468c4dc2148b9a6be74fae877f..5846d4a1ab005232b28958cfb5388683bbcc01f0 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,35 @@ +2003-02-19 Michael Koch <konqueror@gmx.de> + + * gnu/java/nio/ByteBufferImpl.java + (ByteBufferImpl): Renamed two variables. + * gnu/java/nio/CharBufferImpl.java + (CharBufferImpl): Renamed two variables. + * gnu/java/nio/DoubleBufferImpl.java + (DoubleBufferImpl): Renamed two variables. + * gnu/java/nio/FloatBufferImpl.java + (FloatBufferImpl): Renamed two variables. + * gnu/java/nio/IntBufferImpl.java + (IntBufferImpl): Renamed two variables. + * gnu/java/nio/LongBufferImpl.java + (LongBufferImpl): Renamed two variables. + * gnu/java/nio/ShortBufferImpl.java + (ShortBufferImpl): Renamed two variables. + * java/nio/CharBuffer.java + (wrap): Fixed arguments to CharBufferImpl constructor. + (hasArray): Only not read-only buffers have backing arrays. + (length): Documentation added. + (subSequence): Documentation added. + * java/nio/DoubleBuffer.java + (hasArray): Only not read-only buffers have backing arrays. + * java/nio/FloatBuffer.java + (hasArray): Only not read-only buffers have backing arrays. + * java/nio/IntBuffer.java + (hasArray): Only not read-only buffers have backing arrays. + * java/nio/LongBuffer.java + (hasArray): Only not read-only buffers have backing arrays. + * java/nio/ShortBuffer.java + (hasArray): Only not read-only buffers have backing arrays. + 2003-02-19 Michael Koch <konqueror@gmx.de> * javax/accessibility/AccessibleContext.java diff --git a/libjava/gnu/java/nio/ByteBufferImpl.java b/libjava/gnu/java/nio/ByteBufferImpl.java index 19783e578072d49253a2759c1f3c7755fa0dbe2c..149dc1c9683327d5543f47a2cc3b44a255d24048 100644 --- a/libjava/gnu/java/nio/ByteBufferImpl.java +++ b/libjava/gnu/java/nio/ByteBufferImpl.java @@ -60,9 +60,9 @@ public final class ByteBufferImpl extends ByteBuffer readOnly = false; } - public ByteBufferImpl (byte[] array, int off, int lim) + public ByteBufferImpl (byte[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/CharBufferImpl.java b/libjava/gnu/java/nio/CharBufferImpl.java index 07a96fe9c36219f8b7711064f35d5004a5541a10..5126e28f096a447549edf74ecd81c2c073903d00 100644 --- a/libjava/gnu/java/nio/CharBufferImpl.java +++ b/libjava/gnu/java/nio/CharBufferImpl.java @@ -56,9 +56,9 @@ public final class CharBufferImpl extends CharBuffer readOnly = false; } - public CharBufferImpl(char[] array, int off, int lim) + public CharBufferImpl(char[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/DoubleBufferImpl.java b/libjava/gnu/java/nio/DoubleBufferImpl.java index 973487555cb54cb7e45f63710ca90f0716afa8fd..f4dffc2d8f44422f24eb07ca2164b0db5d131d9a 100644 --- a/libjava/gnu/java/nio/DoubleBufferImpl.java +++ b/libjava/gnu/java/nio/DoubleBufferImpl.java @@ -56,9 +56,9 @@ public final class DoubleBufferImpl extends DoubleBuffer readOnly = false; } - public DoubleBufferImpl(double[] array, int off, int lim) + public DoubleBufferImpl(double[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/FloatBufferImpl.java b/libjava/gnu/java/nio/FloatBufferImpl.java index 27a8deaf1c2559f26214ab58f7c57c810539856b..6c77103bb2feea03586a59cb3a9a8d2d72552621 100644 --- a/libjava/gnu/java/nio/FloatBufferImpl.java +++ b/libjava/gnu/java/nio/FloatBufferImpl.java @@ -56,9 +56,9 @@ public final class FloatBufferImpl extends FloatBuffer readOnly = false; } - public FloatBufferImpl(float[] array, int off, int lim) + public FloatBufferImpl(float[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/IntBufferImpl.java b/libjava/gnu/java/nio/IntBufferImpl.java index fda2d68e00a2cf7151021f9f70d803f2b56f5b76..d9f80636aa672f9f7cbefa6b89c5679fed4b43be 100644 --- a/libjava/gnu/java/nio/IntBufferImpl.java +++ b/libjava/gnu/java/nio/IntBufferImpl.java @@ -56,9 +56,9 @@ public final class IntBufferImpl extends IntBuffer readOnly = false; } - public IntBufferImpl(int[] array, int off, int lim) + public IntBufferImpl(int[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/LongBufferImpl.java b/libjava/gnu/java/nio/LongBufferImpl.java index 5dc4992066a10b9817e2085d8392154f64417906..e17f4870b09a3bfea3874a91f8cd146cc6961bab 100644 --- a/libjava/gnu/java/nio/LongBufferImpl.java +++ b/libjava/gnu/java/nio/LongBufferImpl.java @@ -56,9 +56,9 @@ public final class LongBufferImpl extends LongBuffer readOnly = false; } - public LongBufferImpl(long[] array, int off, int lim) + public LongBufferImpl(long[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/gnu/java/nio/ShortBufferImpl.java b/libjava/gnu/java/nio/ShortBufferImpl.java index c55f0989ae92933fd3f8f724d143a47089674b7c..e4c9a060539e21e81288f175c68ea869e4ca6e36 100644 --- a/libjava/gnu/java/nio/ShortBufferImpl.java +++ b/libjava/gnu/java/nio/ShortBufferImpl.java @@ -56,9 +56,9 @@ public final class ShortBufferImpl extends ShortBuffer readOnly = false; } - public ShortBufferImpl(short[] array, int off, int lim) + public ShortBufferImpl(short[] array, int offset, int length) { - super (array.length, lim, off, 0); + super (array.length, length, offset, 0); this.backing_buffer = array; readOnly = false; } diff --git a/libjava/java/nio/CharBuffer.java b/libjava/java/nio/CharBuffer.java index 9d61be90b040c54f558b46b48757377d6e7e0bb2..e299602304777bd4983835fcbc5bf33529f8d890 100644 --- a/libjava/java/nio/CharBuffer.java +++ b/libjava/java/nio/CharBuffer.java @@ -63,7 +63,7 @@ public abstract class CharBuffer extends Buffer */ final public static CharBuffer wrap (char[] array, int offset, int length) { - return new CharBufferImpl (array, offset, offset + length); + return new CharBufferImpl (array, offset, length); } /** @@ -205,7 +205,8 @@ public abstract class CharBuffer extends Buffer */ public final boolean hasArray () { - return backing_buffer != null; + return (backing_buffer != null + && ! isReadOnly ()); } /** @@ -359,6 +360,9 @@ public abstract class CharBuffer extends Buffer return new String (array (), position (), length ()); } + /** + * Returns the length of the remaining chars in this buffer. + */ public final int length () { return remaining (); @@ -370,6 +374,9 @@ public abstract class CharBuffer extends Buffer public abstract ByteOrder order (); /** + * Creates a new character buffer that represents the specified subsequence + * of this buffer, relative to the current position. + * * @exception IndexOutOfBoundsException If the preconditions on start and * end do not hold. */ diff --git a/libjava/java/nio/DoubleBuffer.java b/libjava/java/nio/DoubleBuffer.java index 036579a802b4c6c8584c1fa0f15a5abd3edaa172..27f3a16d34e606289a59aecee6ac2818c3b90118 100644 --- a/libjava/java/nio/DoubleBuffer.java +++ b/libjava/java/nio/DoubleBuffer.java @@ -120,7 +120,8 @@ public abstract class DoubleBuffer extends Buffer implements Comparable public final boolean hasArray() { - return (backing_buffer != null); + return (backing_buffer != null + && !isReadOnly ()); } public final double[] array() diff --git a/libjava/java/nio/FloatBuffer.java b/libjava/java/nio/FloatBuffer.java index 8531cb99f9d1d1b978675db5e8795024333242b5..16c92d61023b59d041f2577c0b4570a45eef0501 100644 --- a/libjava/java/nio/FloatBuffer.java +++ b/libjava/java/nio/FloatBuffer.java @@ -121,7 +121,8 @@ public abstract class FloatBuffer extends Buffer implements Comparable public final boolean hasArray() { - return (backing_buffer != null); + return (backing_buffer != null + && !isReadOnly ()); } public final float[] array() diff --git a/libjava/java/nio/IntBuffer.java b/libjava/java/nio/IntBuffer.java index ddf03d8364dd8879c7b1b739192502b880b9a646..18e353b20139264ddaeb221c74951859f52e9838 100644 --- a/libjava/java/nio/IntBuffer.java +++ b/libjava/java/nio/IntBuffer.java @@ -121,7 +121,8 @@ public abstract class IntBuffer extends Buffer implements Comparable public final boolean hasArray() { - return (backing_buffer != null); + return (backing_buffer != null + && !isReadOnly ()); } public final int[] array() diff --git a/libjava/java/nio/LongBuffer.java b/libjava/java/nio/LongBuffer.java index 63eb5af1a1158f5952dba7f6d572bf0d66c19c6f..8b737194d0cca40e6cff01080eb605e251525f3d 100644 --- a/libjava/java/nio/LongBuffer.java +++ b/libjava/java/nio/LongBuffer.java @@ -121,7 +121,8 @@ public abstract class LongBuffer extends Buffer implements Comparable public final boolean hasArray() { - return (backing_buffer != null); + return (backing_buffer != null + && !isReadOnly ()); } public final long[] array() diff --git a/libjava/java/nio/ShortBuffer.java b/libjava/java/nio/ShortBuffer.java index 7a71cad6d85659b833777b8f28c7e9cab9cf42cc..8c5915dc14865ecf9f0985a82ee8a00dd4b9b881 100644 --- a/libjava/java/nio/ShortBuffer.java +++ b/libjava/java/nio/ShortBuffer.java @@ -121,7 +121,8 @@ public abstract class ShortBuffer extends Buffer implements Comparable public final boolean hasArray() { - return (backing_buffer != null); + return (backing_buffer != null + && !isReadOnly ()); } public final short[] array()