[Patch] gnu.java.nio.SocketChannelImpl

Michael Koch konqueror@gmx.de
Mon Nov 22 21:21:00 GMT 2004


Hi list,


I just commited the attached patch to make blocking SocketChannels
working for read.


Michael


2004-11-22  Michael Koch  <konqueror@gmx.de>

	* gnu/java/nio/SocketChannelImpl.java
	(read): Made check for blocking un-ambiguous.
	Removed wrong check for data array length.

-------------- next part --------------
Index: gnu/java/nio/SocketChannelImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/SocketChannelImpl.java,v
retrieving revision 1.20
diff -u -r1.20 SocketChannelImpl.java
--- gnu/java/nio/SocketChannelImpl.java	21 Nov 2004 20:19:57 -0000	1.20
+++ gnu/java/nio/SocketChannelImpl.java	22 Nov 2004 20:31:48 -0000
@@ -227,12 +227,9 @@
     int available = input.available();
     int len = dst.capacity() - dst.position();
 	
-    if (! isBlocking() && available == 0)
+    if ((! isBlocking()) && available == 0)
       return 0;
     
-    if (len > available)
-      len = available;
-
     if (dst.hasArray())
       {
         offset = dst.arrayOffset() + dst.position();


More information about the Java-patches mailing list