summaryrefslogtreecommitdiff
path: root/java/nio/channels
diff options
context:
space:
mode:
authorCasey Marshall <csm@gnu.org>2006-05-31 00:57:16 +0000
committerCasey Marshall <csm@gnu.org>2006-05-31 00:57:16 +0000
commite0556b51c4223843c801b3cc6a10c13248cff8fd (patch)
tree74511c1caaaad85ef11ab9b524091c0d5d86a9f2 /java/nio/channels
parent92cf25ad0d925e4d753577f3a70359a77e86cea5 (diff)
downloadclasspath-e0556b51c4223843c801b3cc6a10c13248cff8fd.tar.gz
2006-05-30 Casey Marshall <csm@gnu.org>jessie-nio
Merge scatter/gather NIO patch by Michael Barker to branch.
Diffstat (limited to 'java/nio/channels')
-rw-r--r--java/nio/channels/FileChannel.java14
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);
}
/**