diff options
author | Michael Koch <konqueror@gmx.de> | 2003-03-11 10:30:52 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-03-11 10:30:52 +0000 |
commit | b772d2f5927f157e016f434b59a33090c1137c06 (patch) | |
tree | 4ef30ee00b28507236135a22d7c2c45687ab7248 /libjava/java | |
parent | 37bd08f8df0003521d3da3b37a25235fd421bce6 (diff) | |
download | gcc-b772d2f5927f157e016f434b59a33090c1137c06.zip gcc-b772d2f5927f157e016f434b59a33090c1137c06.tar.gz gcc-b772d2f5927f157e016f434b59a33090c1137c06.tar.bz2 |
2003-03-11 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/ByteBufferImpl.java
(putInt): Use limit() instead of limit.
* gnu/java/nio/CharBufferImpl.java
(slice): Fixed implementation.
(subSequence): Better bounds checking.
* gnu/java/nio/MappedByteFileBuffer.java:
Import all needed classes directly.
* java/nio/ByteBuffer.java
(hashCode): New dummy method.
* java/nio/CharBuffer.java
(array_offset): New member variable.
(hasArray): Fixed documentation.
(arrayOffset): Return array_offset.
From-SVN: r64165
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/nio/ByteBuffer.java | 9 | ||||
-rw-r--r-- | libjava/java/nio/CharBuffer.java | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java index 8b7c601..d55ae6d 100644 --- a/libjava/java/nio/ByteBuffer.java +++ b/libjava/java/nio/ByteBuffer.java @@ -247,6 +247,15 @@ public abstract class ByteBuffer extends Buffer implements Comparable } /** + * Returns the current hash code of this buffer. + */ + public int hashCode() + { + // FIXME: Check what SUN calcs here + return super.hashCode(); + } + + /** * Tells whether or not this buffer is equal to another object. */ public boolean equals (Object obj) diff --git a/libjava/java/nio/CharBuffer.java b/libjava/java/nio/CharBuffer.java index e299602..e5b31b4 100644 --- a/libjava/java/nio/CharBuffer.java +++ b/libjava/java/nio/CharBuffer.java @@ -45,6 +45,7 @@ import gnu.java.nio.CharBufferImpl; public abstract class CharBuffer extends Buffer implements Comparable, CharSequence { + protected int array_offset = 0; protected char [] backing_buffer; /** @@ -201,7 +202,7 @@ public abstract class CharBuffer extends Buffer } /** - * Tells wether this is buffer is backed by an array or not. + * Tells wether this is buffer is backed by an accessible array or not. */ public final boolean hasArray () { @@ -242,7 +243,7 @@ public abstract class CharBuffer extends Buffer if (isReadOnly ()) throw new ReadOnlyBufferException (); - return 0; + return array_offset; } /** |