harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (HARMONY-972) [classlib][nio]java.nio.channels.FileChannel.read(ByteBuffer,long) fails to read with a positioned bytebuffer correctly.
Date Tue, 25 Jul 2006 07:46:15 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-972?page=all ]

Paulex Yang resolved HARMONY-972.
---------------------------------

    Resolution: Fixed

Andrew, patch applied at revision r425318, thanks a lot for this enhancement, please verify
that the problem is fully fixed as you expected.


> [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

        

Mime
View raw message