mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francis ANDRE (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DIRMINA-823) Add IoBuffer.putUnsigned* methods to balance the getUnsigned* methods for completeness
Date Tue, 15 Mar 2011 13:57:30 GMT

    [ https://issues.apache.org/jira/browse/DIRMINA-823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006925#comment-13006925
] 

Francis ANDRE commented on DIRMINA-823:
---------------------------------------

IMHO, what is really wrong is the lack of unsigned primitive integral types in Java (but this
is another story, blame to Gossling).

Thus, those methods are doing exactly what it is needed.  For example, some communications
protocols are using non negative values whith a domain from 0 to 65535 and stored as a 2 bytes
bigendian unsigned short.

As a matter of fact, there is no other choice in Java than to compute and use those formal
unsigned short quantities with an int as the container for getting positive computations.
So, those IoBuffer methods have the proper signature for getting the job done. (because in
any case, the result will end in a bigger container as: short & 0xFFFF)

So yes, one should continue the same walk for the putUnsignedXXX counter parts for the same
reasons.

> Add IoBuffer.putUnsigned* methods to balance the getUnsigned* methods for completeness
> --------------------------------------------------------------------------------------
>
>                 Key: DIRMINA-823
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-823
>             Project: MINA
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.2
>         Environment: WXP SP3, Sun SDK 1.5
>            Reporter: Francis ANDRE
>            Priority: Trivial
>
> While unsigned integers types are quite meaningful in  networking protocols,  Java does
not provide unsigned integer primitive types. The IoBuffer.getUnsigned* methods are filling
the gap between the need of  unsigned integers and the real Java programs.
> But IoBuffer does not provide the correlative IoBuffer.putUnsigned* methods. Thus for
completeness, this issue proposes to add those IoBuffer.putUnsigned* methods.
> Rgds

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message