From 0e5e52e6dbbbcfe760182ce407d3bb3713b6582b Mon Sep 17 00:00:00 2001 From: membar Date: Tue, 3 Feb 2004 16:07:24 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77173 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/java/nio/SocketChannelImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libjava/gnu/java/nio/SocketChannelImpl.java') diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java index 4df40b481a6..d490529f873 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; -- cgit v1.2.1