From 3a67f81b5024e963b99d3063424fe8ca8f12efe0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Oct 2013 14:58:58 -0500 Subject: [PATCH] Add the FileChannel class Signed-off-by: Johannes Schindelin --- classpath/java/nio/channels/FileChannel.java | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 classpath/java/nio/channels/FileChannel.java diff --git a/classpath/java/nio/channels/FileChannel.java b/classpath/java/nio/channels/FileChannel.java new file mode 100644 index 0000000000..e94641086a --- /dev/null +++ b/classpath/java/nio/channels/FileChannel.java @@ -0,0 +1,33 @@ +/* Copyright (c) 2008-2013, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +package java.nio.channels; + +import java.io.IOException; +import java.nio.ByteBuffer; + +public abstract class FileChannel implements Channel { + + public static enum MapMode { + PRIVATE, READ_ONLY, READ_WRITE + }; + + public abstract int read(ByteBuffer dst) throws IOException; + + public abstract int read(ByteBuffer dst, long position) throws IOException; + + public abstract int write(ByteBuffer dst) throws IOException; + + public abstract int write(ByteBuffer dst, long position) throws IOException; + + public abstract long position() throws IOException; + + public abstract FileChannel position(long position) throws IOException; +}