diff options
Diffstat (limited to 'libjava/gnu/java')
-rw-r--r-- | libjava/gnu/java/nio/ByteBufferImpl.java | 4 | ||||
-rw-r--r-- | libjava/gnu/java/nio/CharBufferImpl.java | 10 | ||||
-rw-r--r-- | libjava/gnu/java/nio/MappedByteFileBuffer.java | 10 |
3 files changed, 17 insertions, 7 deletions
diff --git a/libjava/gnu/java/nio/ByteBufferImpl.java b/libjava/gnu/java/nio/ByteBufferImpl.java index 149dc1c..342f331 100644 --- a/libjava/gnu/java/nio/ByteBufferImpl.java +++ b/libjava/gnu/java/nio/ByteBufferImpl.java @@ -320,7 +320,7 @@ public final class ByteBufferImpl extends ByteBuffer if (readOnly) throw new ReadOnlyBufferException (); - nio_put_Short (this, position (), limit(), value); + nio_put_Short (this, position (), limit (), value); inc_pos (2); return this; } @@ -352,7 +352,7 @@ public final class ByteBufferImpl extends ByteBuffer if (readOnly) throw new ReadOnlyBufferException (); - nio_put_Int (this, position (), limit , value); + nio_put_Int (this, position (), limit (), value); inc_pos (4); return this; } diff --git a/libjava/gnu/java/nio/CharBufferImpl.java b/libjava/gnu/java/nio/CharBufferImpl.java index 5126e28..f35ae4b 100644 --- a/libjava/gnu/java/nio/CharBufferImpl.java +++ b/libjava/gnu/java/nio/CharBufferImpl.java @@ -98,7 +98,8 @@ public final class CharBufferImpl extends CharBuffer public CharBuffer slice() { - return new CharBufferImpl (this); + return new CharBufferImpl (backing_buffer, arrayOffset () + position (), + remaining ()); } public CharBuffer duplicate() @@ -125,9 +126,10 @@ public final class CharBufferImpl extends CharBuffer final public CharSequence subSequence (int start, int end) { - if (start < 0 || - end > length () || - start > end) + if (start < 0 + || start > length () + || end < start + || end > length ()) throw new IndexOutOfBoundsException (); // No support for direct buffers yet. diff --git a/libjava/gnu/java/nio/MappedByteFileBuffer.java b/libjava/gnu/java/nio/MappedByteFileBuffer.java index e839904..acade62 100644 --- a/libjava/gnu/java/nio/MappedByteFileBuffer.java +++ b/libjava/gnu/java/nio/MappedByteFileBuffer.java @@ -36,7 +36,15 @@ obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package gnu.java.nio; -import java.nio.*; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import java.nio.MappedByteBuffer; import java.io.IOException; final public class MappedByteFileBuffer |