diff options
Diffstat (limited to 'libjava/gnu/java')
-rw-r--r-- | libjava/gnu/java/nio/DatagramChannelImpl.java | 4 | ||||
-rw-r--r-- | libjava/gnu/java/nio/SocketChannelImpl.java | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libjava/gnu/java/nio/DatagramChannelImpl.java b/libjava/gnu/java/nio/DatagramChannelImpl.java index cb2a607..de1d2e6 100644 --- a/libjava/gnu/java/nio/DatagramChannelImpl.java +++ b/libjava/gnu/java/nio/DatagramChannelImpl.java @@ -1,5 +1,5 @@ /* DatagramChannelImpl.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -206,7 +206,7 @@ public final class DatagramChannelImpl extends DatagramChannel try { DatagramPacket packet; - int len = dst.capacity() - dst.position(); + int len = dst.remaining(); if (dst.hasArray()) { diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java index 8ca2b57..cda86e8 100644 --- a/libjava/gnu/java/nio/SocketChannelImpl.java +++ b/libjava/gnu/java/nio/SocketChannelImpl.java @@ -1,5 +1,5 @@ /* SocketChannelImpl.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -225,7 +225,7 @@ public final class SocketChannelImpl extends SocketChannel int offset = 0; InputStream input = socket.getInputStream(); int available = input.available(); - int len = dst.capacity() - dst.position(); + int len = dst.remaining(); if ((! isBlocking()) && available == 0) return 0; @@ -263,7 +263,7 @@ public final class SocketChannelImpl extends SocketChannel } else { - dst.put (data, offset, len); + dst.put (data, offset, readBytes); } return readBytes; |