]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorTom Tromey <tromey@gcc.gnu.org>
Fri, 6 Jan 2006 18:57:36 +0000 (18:57 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 6 Jan 2006 18:57:36 +0000 (18:57 +0000)
2005-12-26  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.

From-SVN: r109422

libjava/ChangeLog
libjava/gnu/java/nio/DatagramChannelImpl.java
libjava/gnu/java/nio/SocketChannelImpl.java

index 4cbb9e738ddf773f3c51fc1e62b29624421069aa..76142c5c543192027f523fb36725bc989f110938 100644 (file)
@@ -1,3 +1,16 @@
+2005-12-26  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.
+
 2006-01-05  Tom Tromey  <tromey@redhat.com>
 
        * java/lang/natThread.cc (finish_): Don't clear 'group'.
index cb2a607934efcc67ecc5274d304c9f156e15ddf4..de1d2e6a341cc2c1c6bf6232b22eec6ba5b45b66 100644 (file)
@@ -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())
           {
index 8ca2b575b41b298aea8a457fa9e2d77ae3bb331f..cda86e80723310d7a574ebf7e04433d595deafb3 100644 (file)
@@ -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;