diff options
Diffstat (limited to 'java/nio')
-rw-r--r-- | java/nio/channels/FileChannel.java | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/java/nio/channels/FileChannel.java b/java/nio/channels/FileChannel.java index 0eefffbe9..3aa199909 100644 --- a/java/nio/channels/FileChannel.java +++ b/java/nio/channels/FileChannel.java @@ -114,12 +114,7 @@ public abstract class FileChannel extends AbstractInterruptibleChannel */ public final long write(ByteBuffer[] srcs) throws IOException { - long result = 0; - - for (int i = 0; i < srcs.length; i++) - result += write(srcs[i]); - - return result; + return write(srcs, 0, srcs.length); } /** @@ -169,12 +164,7 @@ public abstract class FileChannel extends AbstractInterruptibleChannel */ public final long read(ByteBuffer[] dsts) throws IOException { - long result = 0; - - for (int i = 0; i < dsts.length; i++) - read(dsts[i]); - - return result; + return read(dsts, 0, dsts.length); } /** |