2003-02-19 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Wed, 19 Feb 2003 11:47:49 +0000 (11:47 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Wed, 19 Feb 2003 11:47:49 +0000 (11:47 +0000)
* 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.

From-SVN: r63101

14 files changed:
libjava/ChangeLog
libjava/gnu/java/nio/ByteBufferImpl.java
libjava/gnu/java/nio/CharBufferImpl.java
libjava/gnu/java/nio/DoubleBufferImpl.java
libjava/gnu/java/nio/FloatBufferImpl.java
libjava/gnu/java/nio/IntBufferImpl.java
libjava/gnu/java/nio/LongBufferImpl.java
libjava/gnu/java/nio/ShortBufferImpl.java
libjava/java/nio/CharBuffer.java
libjava/java/nio/DoubleBuffer.java
libjava/java/nio/FloatBuffer.java
libjava/java/nio/IntBuffer.java
libjava/java/nio/LongBuffer.java
libjava/java/nio/ShortBuffer.java

index 7c54d610be9728468c4dc2148b9a6be74fae877f..5846d4a1ab005232b28958cfb5388683bbcc01f0 100644 (file)
@@ -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
index 19783e578072d49253a2759c1f3c7755fa0dbe2c..149dc1c9683327d5543f47a2cc3b44a255d24048 100644 (file)
@@ -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;
   }
index 07a96fe9c36219f8b7711064f35d5004a5541a10..5126e28f096a447549edf74ecd81c2c073903d00 100644 (file)
@@ -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;
   }
index 973487555cb54cb7e45f63710ca90f0716afa8fd..f4dffc2d8f44422f24eb07ca2164b0db5d131d9a 100644 (file)
@@ -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;
   }
index 27a8deaf1c2559f26214ab58f7c57c810539856b..6c77103bb2feea03586a59cb3a9a8d2d72552621 100644 (file)
@@ -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;
   }
index fda2d68e00a2cf7151021f9f70d803f2b56f5b76..d9f80636aa672f9f7cbefa6b89c5679fed4b43be 100644 (file)
@@ -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;
   }
index 5dc4992066a10b9817e2085d8392154f64417906..e17f4870b09a3bfea3874a91f8cd146cc6961bab 100644 (file)
@@ -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;
   }
index c55f0989ae92933fd3f8f724d143a47089674b7c..e4c9a060539e21e81288f175c68ea869e4ca6e36 100644 (file)
@@ -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;
   }
index 9d61be90b040c54f558b46b48757377d6e7e0bb2..e299602304777bd4983835fcbc5bf33529f8d890 100644 (file)
@@ -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.
    */
index 036579a802b4c6c8584c1fa0f15a5abd3edaa172..27f3a16d34e606289a59aecee6ac2818c3b90118 100644 (file)
@@ -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()
index 8531cb99f9d1d1b978675db5e8795024333242b5..16c92d61023b59d041f2577c0b4570a45eef0501 100644 (file)
@@ -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()
index ddf03d8364dd8879c7b1b739192502b880b9a646..18e353b20139264ddaeb221c74951859f52e9838 100644 (file)
@@ -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()
index 63eb5af1a1158f5952dba7f6d572bf0d66c19c6f..8b737194d0cca40e6cff01080eb605e251525f3d 100644 (file)
@@ -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()
index 7a71cad6d85659b833777b8f28c7e9cab9cf42cc..8c5915dc14865ecf9f0985a82ee8a00dd4b9b881 100644 (file)
@@ -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()