From 4b6eac52d5cddac6803e3bb762523da95f571bf6 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 2 May 2003 05:35:57 +0000 Subject: 2003-05-02 Michael Koch * gnu/java/nio/FileChannelImpl.java (read): New implementation. (implRead): New methods. (write): New implementation, call other write insteal of read method. (implWrite): New methods. (map): Added comment. (transferFrom): Implemented. (transferTo): Implemented. (lock): Added checks to throw exceptions. (truncate): Added check to throw exception. * gnu/java/nio/natFileChannelImpl.cc (implRead): New method. (implWrite): New method. * java/nio/ByteBuffer.java (hashCode): Fixed comment. (get): Fixed exception documentation. (put): Fixed exception documentation. * java/nio/CharBuffer.java: Added comment for later optimizations. From-SVN: r66373 --- libjava/java/nio/ByteBuffer.java | 8 +++++--- libjava/java/nio/CharBuffer.java | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'libjava/java') diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java index b3e72aa..5a687ca 100644 --- a/libjava/java/nio/ByteBuffer.java +++ b/libjava/java/nio/ByteBuffer.java @@ -251,7 +251,7 @@ public abstract class ByteBuffer extends Buffer implements Comparable */ public int hashCode() { - // FIXME: Check what SUN calcs here + // FIXME: Check what SUN calculates here return super.hashCode(); } @@ -344,7 +344,8 @@ public abstract class ByteBuffer extends Buffer implements Comparable /** * Absolute get method. * - * @exception IndexOutOfBoundsException FIXME + * @exception IndexOutOfBoundsException If index < 0 or index >= this + * buffers limit. */ public abstract byte get (int index); @@ -352,7 +353,8 @@ public abstract class ByteBuffer extends Buffer implements Comparable * Absolute put method. * * @exception ReadOnlyBufferException If this buffer is read-only - * @exception IndexOutOfBoundsException FIXME + * @exception IndexOutOfBoundsException If index < 0 or index >= this + * buffers limit. */ public abstract ByteBuffer put (int index, byte b); diff --git a/libjava/java/nio/CharBuffer.java b/libjava/java/nio/CharBuffer.java index e5b31b4..e2f8d5e 100644 --- a/libjava/java/nio/CharBuffer.java +++ b/libjava/java/nio/CharBuffer.java @@ -83,6 +83,9 @@ public abstract class CharBuffer extends Buffer */ final public static CharBuffer wrap (CharSequence a, int offset, int length) { + // FIXME: implement better handling of java.lang.String. + // Probably share data with String via reflection. + if ((offset < 0) || (offset > a.length ()) || (length < 0) -- cgit v1.1