public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: merge nio fixes
@ 2006-01-06 18:57 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2006-01-06 18:57 UTC (permalink / raw)
  To: Java Patch List

I'm checking this in on the trunk and the 4.1 branch.

I happened to notice that Anthony's NIO changes were applied to
Classpath, but that we needed them in libgcj as well due to a minor
divergence.

Tom

Index: ChangeLog
from  Anthony Green  <green@redhat.com>

	* gnu/java/nio/SocketChannelImpl.java (read): Compute the right amount
	of data to read (dst.remaining()).
	* gnu/java/nio/DatagramChannelImpl.java (receive): Ditto.

2005-11-11  Mark Wielaard  <mark@klomp.org>

	Reported by john.zigman@anu.edu.au as bug #24608.
	* gnu/java/nio/SocketChannelImpl.java (read): Put readBytes in
	destination ByteBuffer when it doesn't have an array instead of len
	bytes.

Index: gnu/java/nio/SocketChannelImpl.java
===================================================================
--- gnu/java/nio/SocketChannelImpl.java	(revision 109382)
+++ gnu/java/nio/SocketChannelImpl.java	(working copy)
@@ -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 @@
     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 @@
 	}
       else
         {
-          dst.put (data, offset, len);
+          dst.put (data, offset, readBytes);
         }
 
     return readBytes;
Index: gnu/java/nio/DatagramChannelImpl.java
===================================================================
--- gnu/java/nio/DatagramChannelImpl.java	(revision 109382)
+++ gnu/java/nio/DatagramChannelImpl.java	(working copy)
@@ -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 @@
     try
       {
         DatagramPacket packet;
-        int len = dst.capacity() - dst.position();
+        int len = dst.remaining();
         
         if (dst.hasArray())
           {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-06 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-06 18:57 Patch: FYI: merge nio fixes Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).