From b1d2f66194416e2d062db8469f8e6f8af712402c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 3 Dec 2013 14:07:37 -0600 Subject: [PATCH] Add FileChannel#size() Signed-off-by: Johannes Schindelin --- classpath/java/io/RandomAccessFile.java | 4 ++++ classpath/java/nio/channels/FileChannel.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/classpath/java/io/RandomAccessFile.java b/classpath/java/io/RandomAccessFile.java index f411bbe748..c95b151e62 100644 --- a/classpath/java/io/RandomAccessFile.java +++ b/classpath/java/io/RandomAccessFile.java @@ -193,6 +193,10 @@ public class RandomAccessFile { seek(position); return this; } + + public long size() throws IOException { + return length(); + } }; } } diff --git a/classpath/java/nio/channels/FileChannel.java b/classpath/java/nio/channels/FileChannel.java index e94641086a..30ccff32ba 100644 --- a/classpath/java/nio/channels/FileChannel.java +++ b/classpath/java/nio/channels/FileChannel.java @@ -30,4 +30,6 @@ public abstract class FileChannel implements Channel { public abstract long position() throws IOException; public abstract FileChannel position(long position) throws IOException; + + public abstract long size() throws IOException; }