harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Harley (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-683) [classlib][nio] java.nio.channels.DatagramChannel.write fails to write ByteBuffer whose position is not zero.
Date Wed, 28 Jun 2006 10:24:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-683?page=all ]
     
George Harley resolved HARMONY-683:
-----------------------------------

    Resolution: Fixed

Hi Andrew, 

Good catch ! Your patch has been committed in revision 417714. Please could you verify that
it has been applied as expected. 

Thanks, 
George

> [classlib][nio] java.nio.channels.DatagramChannel.write fails to write ByteBuffer whose
position is not zero.
> -------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-683
>          URL: http://issues.apache.org/jira/browse/HARMONY-683
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Andrew Zhang
>     Assignee: George Harley
>  Attachments: nio.diff
>
> java.nio.channels.DatagramChannel.write(ByteBuffer),write(ByteBuffer,int,int) fails to
write ByteBuffer whose position is not zero.
> Following test case reproduces the bug. 
> I'll upload a patch soon. Thanks!
> Test Case:
>         public void test_write_buffer_positioned() throws Exception {
>         int CAPACITY_NORMAL = 256;
>         int postion = 16;
>         DatagramChannel dc = DatagramChannel.open();
>         SocketAddress addr = new InetSocketAddress("127.0.0.1",
>                 50000);
>         byte[] sourceArray = new byte[CAPACITY_NORMAL];        
>         dc.connect(addr);
>         // write
>         ByteBuffer sourceBuf = ByteBuffer.wrap(sourceArray);
>         sourceBuf.position(postion);
>         assertEquals(CAPACITY_NORMAL - postion, dc.write(sourceBuf));
>     }
> Test result:
>  RI 5.0 passes the test while Harmony fails.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message