diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
commit | 97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/gnu/java/nio/channels | |
parent | c648dedbde727ca3f883bb5fd773aa4af70d3369 (diff) | |
download | gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.zip gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.gz gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.bz2 |
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/gnu/java/nio/channels')
-rw-r--r-- | libjava/gnu/java/nio/channels/FileChannelImpl.h | 118 | ||||
-rw-r--r-- | libjava/gnu/java/nio/channels/FileChannelImpl.java | 8 |
2 files changed, 126 insertions, 0 deletions
diff --git a/libjava/gnu/java/nio/channels/FileChannelImpl.h b/libjava/gnu/java/nio/channels/FileChannelImpl.h new file mode 100644 index 0000000..34099c5 --- /dev/null +++ b/libjava/gnu/java/nio/channels/FileChannelImpl.h @@ -0,0 +1,118 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __gnu_java_nio_channels_FileChannelImpl__ +#define __gnu_java_nio_channels_FileChannelImpl__ + +#pragma interface + +#include <java/nio/channels/FileChannel.h> +#include <gcj/array.h> + +extern "Java" +{ + namespace gnu + { + namespace java + { + namespace nio + { + namespace channels + { + class FileChannelImpl; + } + } + } + } + namespace java + { + namespace nio + { + class ByteBuffer; + class MappedByteBuffer; + namespace channels + { + class FileChannel; + class FileChannel$MapMode; + class FileLock; + class ReadableByteChannel; + class WritableByteChannel; + } + } + } +} + +class gnu::java::nio::channels::FileChannelImpl : public ::java::nio::channels::FileChannel +{ + + static void init(); +public: + FileChannelImpl(); + static ::gnu::java::nio::channels::FileChannelImpl * create(::java::io::File *, jint); +private: + FileChannelImpl(::java::io::File *, jint); +public: // actually package-private + FileChannelImpl(jint, jint); +private: + jint open(::java::lang::String *, jint); +public: + jint available(); +private: + jlong implPosition(); + void seek(jlong); + void implTruncate(jlong); +public: + void unlock(jlong, jlong); + jlong size(); +public: // actually protected + void implCloseChannel(); + void finalize(); +public: + jint read(::java::nio::ByteBuffer *); + jint read(::java::nio::ByteBuffer *, jlong); + jint read(); + jint read(JArray< jbyte > *, jint, jint); + jlong read(JArray< ::java::nio::ByteBuffer * > *, jint, jint); + jint write(::java::nio::ByteBuffer *); + jint write(::java::nio::ByteBuffer *, jlong); + void write(JArray< jbyte > *, jint, jint); + void write(jint); + jlong write(JArray< ::java::nio::ByteBuffer * > *, jint, jint); + ::java::nio::MappedByteBuffer * mapImpl(jchar, jlong, jint); + ::java::nio::MappedByteBuffer * map(::java::nio::channels::FileChannel$MapMode *, jlong, jlong); + void force(jboolean); +private: + jint smallTransferTo(jlong, jint, ::java::nio::channels::WritableByteChannel *); +public: + jlong transferTo(jlong, jlong, ::java::nio::channels::WritableByteChannel *); +private: + jint smallTransferFrom(::java::nio::channels::ReadableByteChannel *, jlong, jint); +public: + jlong transferFrom(::java::nio::channels::ReadableByteChannel *, jlong, jlong); + ::java::nio::channels::FileLock * tryLock(jlong, jlong, jboolean); +private: + jboolean lock(jlong, jlong, jboolean, jboolean); +public: + ::java::nio::channels::FileLock * lock(jlong, jlong, jboolean); + jlong position(); + ::java::nio::channels::FileChannel * position(jlong); + ::java::nio::channels::FileChannel * truncate(jlong); + jint getNativeFD(); + static const jint READ = 1; + static const jint WRITE = 2; + static const jint APPEND = 4; + static const jint EXCL = 8; + static const jint SYNC = 16; + static const jint DSYNC = 32; +private: + jint __attribute__((aligned(__alignof__( ::java::nio::channels::FileChannel)))) fd; + jlong pos; + jint mode; +public: + static ::gnu::java::nio::channels::FileChannelImpl * in; + static ::gnu::java::nio::channels::FileChannelImpl * out; + static ::gnu::java::nio::channels::FileChannelImpl * err; + static ::java::lang::Class class$; +}; + +#endif // __gnu_java_nio_channels_FileChannelImpl__ diff --git a/libjava/gnu/java/nio/channels/FileChannelImpl.java b/libjava/gnu/java/nio/channels/FileChannelImpl.java index db68b59..c1f79a4 100644 --- a/libjava/gnu/java/nio/channels/FileChannelImpl.java +++ b/libjava/gnu/java/nio/channels/FileChannelImpl.java @@ -533,4 +533,12 @@ public final class FileChannelImpl extends FileChannel return this; } + + /** + * @return The native file descriptor. + */ + public int getNativeFD() + { + return fd; + } } |