summaryrefslogtreecommitdiff
path: root/gnu/java/nio/FileChannelImpl.java
diff options
context:
space:
mode:
authorRonald Veldema <rveldema@cs.vu.nl>2002-03-11 16:24:12 +0000
committerRonald Veldema <rveldema@cs.vu.nl>2002-03-11 16:24:12 +0000
commit4dd1666fff1bd101b979357e9fd7f50a430884b0 (patch)
tree12cafc867be5431a42a75ffddf7881b2ac0749dc /gnu/java/nio/FileChannelImpl.java
parent5158e5cd020ca88753de8793a40dcda66f3ea8ae (diff)
downloadclasspath-4dd1666fff1bd101b979357e9fd7f50a430884b0.tar.gz
*** empty log message ***
Diffstat (limited to 'gnu/java/nio/FileChannelImpl.java')
-rw-r--r--gnu/java/nio/FileChannelImpl.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/gnu/java/nio/FileChannelImpl.java b/gnu/java/nio/FileChannelImpl.java
new file mode 100644
index 000000000..4e4505916
--- /dev/null
+++ b/gnu/java/nio/FileChannelImpl.java
@@ -0,0 +1,70 @@
+package manta.runtime;
+
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+
+
+public class FileChannelImpl extends FileChannel
+{
+ long address;
+ int fd;
+ MappedByteBuffer buf;
+ Object file_obj; // just to keep it live...
+
+ FileChannelImpl(int fd,
+ Object obj)
+ {
+ this.fd = fd;
+ this.file_obj = obj;
+ }
+
+ FileChannelImpl(FileDescriptor fd,
+ Object obj)
+ {
+ this(fd.file_des, obj);
+ }
+
+
+ public int read(java.nio.ByteBuffer dst) throws IOException
+ {
+ System.out.println("in here-1");
+ return 0;
+ }
+
+ public int write(java.nio.ByteBuffer src) throws IOException
+ {
+ System.out.println("in here-2");
+ return 0;
+ }
+
+ public int write(java.nio.ByteBuffer[] srcs,
+ int offset,
+ int length) throws IOException
+ {
+ System.out.println("in here-3");
+ return 0;
+ }
+
+ static MantaNative long nio_mmap_file(int fd,
+ long pos,
+ int size,
+ int mode);
+
+ static MantaNative void nio_unmmap_file(int fd,
+ long pos,
+ int size);
+
+ public MappedByteBuffer map(java.nio.channels.FileChannel.MapMode mode,
+ long position,
+ int size) throws IOException
+ {
+ int cmode = 0;
+
+ address = nio_mmap_file(fd, position, size, cmode);
+
+ buf = new MappedByteFileBuffer(this);
+ return buf;
+ }
+}
+