ChannelBuffer ByteOrder

mwhited mwhited at nphase.com
Mon May 17 18:12:55 EDT 2010


Is there a way to switch the byteOrder on an existing ChannelBuffer.

The issue I am running into is that I have a FrameDecoder to decode incoming
packets that have the following format

Byte Order Identifier
Length
Data

The server can accept connections from LITTLE_ENDIAN or BIG_ENDIAN clients,
and I don't know what order a Channel is using until I receive the first
packet on the channel.

Currently I have an implementation that works, but it involves copying the
existing buffer into a temporary ChannelBuffer with the correct byte order.

I realize I can set the BufferFactory for the Channel to the correct byte
order so subsequent ChannelBuffers will be the correct order, but that still
leaves me copying buffers around for the first packet.

Thanks,
Matt
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/ChannelBuffer-ByteOrder-tp5067367p5067367.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list