[JBoss JIRA] Closed: (NETTY-228) Method "ChannelBuffers.wrappedBuffer(ByteBuffer buffer)" does not always honor ByteOrder

Trustin Lee (JIRA) jira-events at lists.jboss.org
Sun Sep 20 21:24:49 EDT 2009


     [ https://jira.jboss.org/jira/browse/NETTY-228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trustin Lee closed NETTY-228.
-----------------------------

    Fix Version/s: 3.1.4.GA
       Resolution: Done


Thanks a lot for reporting this issue.  I've just checked in the fix as you suggested. :)

> Method "ChannelBuffers.wrappedBuffer(ByteBuffer buffer)" does not always honor ByteOrder
> ----------------------------------------------------------------------------------------
>
>                 Key: NETTY-228
>                 URL: https://jira.jboss.org/jira/browse/NETTY-228
>             Project: Netty
>          Issue Type: Bug
>          Components: Buffer
>    Affects Versions: 3.1.3.GA
>            Reporter: xjn xjn
>            Assignee: Trustin Lee
>             Fix For: 3.1.4.GA
>
>
> This results sonetimes in wrong buffer ByteOrder on using NioDatagramChannelFactory with "bufferFactory" set to LITTLE_ENDIAN  Factories
> ChannelBuffers Rev 1685 Line 296
> 296             return wrappedBuffer(buffer.array(), buffer.arrayOffset(),buffer.remaining());
> should be changed to
> 296             return wrappedBuffer(buffer.order(), buffer.array(), buffer.arrayOffset(),buffer.remaining());
> public static ChannelBuffer wrappedBuffer(ByteBuffer buffer) {
> 292         if (!buffer.hasRemaining()) {
> 293             return EMPTY_BUFFER;
> 294         }
> 295         if (!buffer.isReadOnly() && buffer.hasArray()) {
> 296             return wrappedBuffer(buffer.array(), buffer.arrayOffset(),buffer.remaining());
> 297         } else {
> 298             return new ByteBufferBackedChannelBuffer(buffer);
> 299         }
> 300     }

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

        


More information about the netty-dev mailing list