aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/nio/SocketChannelImpl.java
diff options
context:
space:
mode:
authorMohan Embar <gnustuff@thisiscool.com>2004-02-03 16:07:24 +0000
committerMohan Embar <membar@gcc.gnu.org>2004-02-03 16:07:24 +0000
commit8696d927c03a0551bfdc7ab8acc756d31d468592 (patch)
tree0f48b5ad32382781358369642827a7d8b293ae29 /libjava/gnu/java/nio/SocketChannelImpl.java
parent9b66ebb1460daae2b046d62d50d7c3c835ba1c43 (diff)
downloadgcc-8696d927c03a0551bfdc7ab8acc756d31d468592.zip
gcc-8696d927c03a0551bfdc7ab8acc756d31d468592.tar.gz
gcc-8696d927c03a0551bfdc7ab8acc756d31d468592.tar.bz2
* gnu/java/nio/DatagramChannelImpl.java
(inChannelOperation): New field. (isInChannelOperation): New accessor. (setInChannelOperation): New modifier. (receive): Use capacity() - position() of destination buffer instead of remaining(). Set and reset our "in channel operation indicator" before and after delegating the receive to our datagram socket. Removed testing code. Update destination buffer's current position if it is backed by a byte array (hasArray() is true). (send): Set and reset our "in channel operation indicator" before and after delegating the send to our datagram socket. Removed testing code. Update source buffer's current position if it is backed by a byte array (hasArray() is true). * gnu/java/nio/SocketChannelImpl.java (read(ByteBuffer)): Use capacity() - position() of destination buffer instead of remaining(). * java/net/DatagramSocket.java (receive): Don't throw an IllegalBlockingModeException if we have a non-blocking channel which initiated this operation. (send): Likewise. From-SVN: r77173
Diffstat (limited to 'libjava/gnu/java/nio/SocketChannelImpl.java')
-rw-r--r--libjava/gnu/java/nio/SocketChannelImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java
index 4df40b4..d490529 100644
--- a/libjava/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/gnu/java/nio/SocketChannelImpl.java
@@ -226,7 +226,7 @@ public final class SocketChannelImpl extends SocketChannel
int offset = 0;
InputStream input = socket.getInputStream();
int available = input.available();
- int len = dst.remaining();
+ int len = dst.capacity() - dst.position();
if (available == 0)
return 0;