You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Zhang (JIRA)" <ji...@apache.org> on 2006/07/28 11:12:17 UTC
[jira] Commented: (HARMONY-972)
[classlib][nio]java.nio.channels.FileChannel.read(ByteBuffer,long) fails to
read with a positioned bytebuffer correctly.
[ http://issues.apache.org/jira/browse/HARMONY-972?page=comments#action_12424035 ]
Andrew Zhang commented on HARMONY-972:
--------------------------------------
Hi Paulex,
The fix looks good, many thanks!
Best regards,
Andrew
> [classlib][nio]java.nio.channels.FileChannel.read(ByteBuffer,long) fails to read with a positioned bytebuffer correctly.
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-972
> URL: http://issues.apache.org/jira/browse/HARMONY-972
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: Paulex Yang
> Attachments: nio.diff
>
>
> Hi,
> java.nio.channels.FileChannel.read(ByteBuffer,long) fails to read with a positioned bytebuffer correctly.
> testcase:
> public void test_readLByteBufferJ() throws Exception {
> writeDataToFile(fileOfReadOnlyFileChannel);
> ByteBuffer readBuffer = ByteBuffer.allocate(CAPACITY);
> final int BUFFER_POSITION = 1;
> readBuffer.position(BUFFER_POSITION);
> final int POSITION = 2;
> int result = readOnlyFileChannel.read(readBuffer, POSITION);
> assertEquals(CONTENT_AS_BYTES_LENGTH - POSITION, result);
> assertEquals(BUFFER_POSITION + result, readBuffer.position());
> readBuffer.flip();
> readBuffer.position(BUFFER_POSITION);
> for (int i = POSITION; i < CONTENT_AS_BYTES_LENGTH; i++) {
> assertEquals(CONTENT_AS_BYTES[i], readBuffer.get());
> }
> }
> It passes against RI while fails against Harmony
--
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