diff options
author | Michael Koch <konqueror@gmx.de> | 2003-05-02 05:35:57 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-05-02 05:35:57 +0000 |
commit | 4b6eac52d5cddac6803e3bb762523da95f571bf6 (patch) | |
tree | 4aa891e39e8bfb18f8fb0e1d235f4f3bf97600d1 /libjava/gnu/java/nio/natFileChannelImpl.cc | |
parent | c67528fe19d425cf537589701f67218ff729130b (diff) | |
download | gcc-4b6eac52d5cddac6803e3bb762523da95f571bf6.zip gcc-4b6eac52d5cddac6803e3bb762523da95f571bf6.tar.gz gcc-4b6eac52d5cddac6803e3bb762523da95f571bf6.tar.bz2 |
2003-05-02 Michael Koch <konqueror@gmx.de>
* 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
Diffstat (limited to 'libjava/gnu/java/nio/natFileChannelImpl.cc')
-rw-r--r-- | libjava/gnu/java/nio/natFileChannelImpl.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/gnu/java/nio/natFileChannelImpl.cc b/libjava/gnu/java/nio/natFileChannelImpl.cc index 9413a77..b33a79f 100644 --- a/libjava/gnu/java/nio/natFileChannelImpl.cc +++ b/libjava/gnu/java/nio/natFileChannelImpl.cc @@ -28,6 +28,7 @@ details. */ #include <gnu/java/nio/FileChannelImpl.h> #include <java/io/FileDescriptor.h> #include <java/io/IOException.h> +#include <java/nio/ByteBuffer.h> #include <java/nio/channels/FileChannel.h> jlong @@ -49,6 +50,21 @@ gnu::java::nio::FileChannelImpl::implPosition (jlong newPosition) return this; } +jint +gnu::java::nio::FileChannelImpl::implRead (JArray<jbyte>* buffer, + jint offset, jint len) +{ + return fd->read (buffer, offset, len); +} + +jint +gnu::java::nio::FileChannelImpl::implWrite (JArray<jbyte>* buffer, + jint offset, jint len) +{ + fd->write (buffer, offset, len); + return len; +} + java::nio::channels::FileChannel* gnu::java::nio::FileChannelImpl::implTruncate (jlong size) { |