[JBoss JIRA] Commented: (NETTY-253) Add several usefull getters and setters to ChannelBuffer class

Tuomas Kiviaho (JIRA) jira-events at lists.jboss.org
Tue Nov 17 07:14:29 EST 2009


    [ https://jira.jboss.org/jira/browse/NETTY-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12494974#action_12494974 ] 

Tuomas Kiviaho commented on NETTY-253:
--------------------------------------

I would be delighted if java.nio.charset.Charset would be added to the list although this request isn't amongst ByteBuffer methods. Currently toString() only accepts string value but at implementation level String generation would allow direct usage of Charset (thus not swallowing possible UnsupportedEncodingException). 

> Add several usefull getters and setters to ChannelBuffer class
> --------------------------------------------------------------
>
>                 Key: NETTY-253
>                 URL: https://jira.jboss.org/jira/browse/NETTY-253
>             Project: Netty
>          Issue Type: Feature Request
>          Components: Core API
>    Affects Versions: 3.1.5.GA
>            Reporter: Ruslan Shostak
>            Assignee: Trustin Lee
>
> The proposal is to implement the following methods in ChannelBuffer.
> (comments taken from ByteBuffer class (http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html)
> 1) getChar() 
> Reads the next two bytes at this buffer's current position
> 2) 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.
> 3) 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.
> 4) putChar()
> Relative put method for writing a char value
> -putFloat()
> Writes four bytes containing the given float value, in the current byte order, into this buffer at the given index. 
> 5) putDouble()
> Writes eight bytes containing the given double value, in the current byte order, into this buffer at the current position, and then increments the position by eight. 
> 6) array()
> Returns the byte array that backs this buffer

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