Usefull ByteBuffer methods are not present in ChannelBuffer

Thomas Bocek bocek at ifi.uzh.ch
Fri Nov 13 11:00:19 EST 2009


Hi Atra,

You can use longBitsToDouble(long), doubleToRawLongBits(double value),
doubleToLongBits(double value), etc. and use putLong()/getLong()

Cheers,

Thomas

Atra wrote:
> Hi,
> 
> I am trying to replace some code where ByteBuffer is used with
> ChannelBuffer, but found that the following methods are absent:
> 
> -getChar() Reads the next two bytes at this buffer's current position
> -getFloat() Reads the next four bytes at this buffer's current position,
>    composing them into a float value according to the current byte order,
>    and then increments the position by four. 
> -getDouble() Reads the next eight bytes at this buffer's current position,
>    composing them into a double value according to the current byte order,
>    and then increments the position by eight.
> -putChar()
> -putFloat()
> -putDouble()
> 
> -array() The array that backs this buffer
> 
> is there a way to add them as standart methods (like readChar() etc.) to
> ChannelBuffer and not trying to implementing them on my own?
> Thanks.


More information about the netty-users mailing list