Usefull ByteBuffer methods are not present in ChannelBuffer

Trustin Lee (이희승) trustin at gmail.com
Tue Nov 17 03:13:56 EST 2009


On Tue, Nov 17, 2009 at 4:26 PM, Atra <dhchem at mail.ru> wrote:
>
>
> Thomas Bocek wrote:
>>
>> Hi Atra,
>>
>> You can use longBitsToDouble(long), doubleToRawLongBits(double value),
>> doubleToLongBits(double value), etc. and use putLong()/getLong()
>>
>> Cheers,
>>
>> Thomas
>>
>>
>
> Hi Thomas,
>
> thanks for the usefull hint. Yes, with float and double this will work. With
> char it is also possible to do some bits operations (just looking at
> ByteBuffer source). But the general idea is to not reinvent the wheel. I'm
> pretty sure everyone who deals with some custom protocol needs those methods
> and its not good to reinvent the wheel.
>
> Btw may be I should create a feature request in JIRA?

That would be great.  Thanks in advance! :)

Cheers

— Trustin Lee, http://gleamynode.net/



More information about the netty-users mailing list