diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-02 15:57:13 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-02 15:57:13 +0000 |
| commit | 8cef25e737d97238751152631de70237a2aabaa4 (patch) | |
| tree | 7f7a771b552d63a7e8628e711227791e9c6ab053 /libjava/gnu/java/nio/natFileChannelImpl.cc | |
| parent | 55afb57985329fd1694e689b0d506a621b057795 (diff) | |
| download | gcc-8cef25e737d97238751152631de70237a2aabaa4.tar.gz | |
2003-03-02 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/FileChannelImpl.java
(fd): Type FileDescriptor instead of int.
(lengthInternal): Removed.
(FileChannelImpl): Fixed arguments, check type of file object.
(size): Made it native.
(implPosition): New native method.
(implTruncate): New native method.
(position): Implemented.
(truncate): Implemented.
(nio_mmap_file): Changed arguments.
(nio_munmap_file): Changed arguments.
(nio_msync): Changed arguments.
* gnu/java/nio/natFileChannelImpl.cc
(lengthInternal): Removed.
(size): New method.
(implPosition): New method.
(implTruncate): New method.
(nio_mmap_file): Changed arguments.
(nio_munmap_file): Changed arguments.
(nio_msync): Changed arguments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/nio/natFileChannelImpl.cc')
| -rw-r--r-- | libjava/gnu/java/nio/natFileChannelImpl.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/natFileChannelImpl.cc b/libjava/gnu/java/nio/natFileChannelImpl.cc index 87386305bc6..8ba838255b5 100644 --- a/libjava/gnu/java/nio/natFileChannelImpl.cc +++ b/libjava/gnu/java/nio/natFileChannelImpl.cc @@ -25,29 +25,50 @@ details. */ #endif #include <gnu/java/nio/FileChannelImpl.h> +#include <java/io/FileDescriptor.h> #include <java/io/IOException.h> #include <java/nio/channels/FileChannel.h> jlong -gnu::java::nio::FileChannelImpl::lengthInternal (jint fd) +gnu::java::nio::FileChannelImpl::size () { - throw new ::java::io::IOException (JvNewStringUTF ("lengthInternal not implemented")); + return fd->length (); } jlong -gnu::java::nio::FileChannelImpl::nio_mmap_file (jint, jlong, jint, jint) +gnu::java::nio::FileChannelImpl::implPosition () +{ + return fd->getFilePointer (); +} + +java::nio::channels::FileChannel* +gnu::java::nio::FileChannelImpl::implPosition (jlong newPosition) +{ + fd->seek (newPosition, ::java::io::FileDescriptor::SET, true); + return this; +} + +java::nio::channels::FileChannel* +gnu::java::nio::FileChannelImpl::implTruncate (jlong size) +{ + fd->setLength (size); + return this; +} + +jlong +gnu::java::nio::FileChannelImpl::nio_mmap_file (jlong, jlong, jint) { throw new ::java::io::IOException (JvNewStringUTF ("mmap not implemented")); } void -gnu::java::nio::FileChannelImpl::nio_unmmap_file (jint, jlong, jint) +gnu::java::nio::FileChannelImpl::nio_unmmap_file (jlong, jint) { throw new ::java::io::IOException (JvNewStringUTF ("munmap not implemented")); } void -gnu::java::nio::FileChannelImpl::nio_msync (jint, jlong, jint) +gnu::java::nio::FileChannelImpl::nio_msync (jlong, jint) { throw new ::java::io::IOException (JvNewStringUTF ("msync not implemented")); } |
