You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2006/07/03 12:42:30 UTC
[jira] Assigned: (HARMONY-701) [classlib][nio]
java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends
data incorrectly if the position of ByteBuffer is not zero.
[ http://issues.apache.org/jira/browse/HARMONY-701?page=all ]
Tim Ellison reassigned HARMONY-701:
-----------------------------------
Assign To: Tim Ellison
> [classlib][nio] java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends data incorrectly if the position of ByteBuffer is not zero.
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-701
> URL: http://issues.apache.org/jira/browse/HARMONY-701
> Project: Harmony
> Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assignee: Tim Ellison
> Attachments: nio.diff
>
> java.nio.channels.DatagramChannel.send(ByteBuffer, SocketAddress) sends data incorrectly if the position of ByteBuffer is not zero.
> Following test case reproduces the bug.
> I'll upload a patch soon. Thanks!
> Test case:
> public void test_send_LBuffer_LSocketAddress_PositionNotZero() 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];
> // send ByteBuffer whose position is not zero
> ByteBuffer sourceBuf = ByteBuffer.wrap(sourceArray);
> sourceBuf.position(postion);
> assertEquals(CAPACITY_NORMAL - postion, dc.send(sourceBuf, addr));
> }
> Test result:
> RI 5.0 passes the test while Harmony fails.
> Best regards,
> Andrew
--
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