You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2006/08/03 09:39:18 UTC

[poll] Where to set the default byte order?

Hi,

Currently, the default byte order of all buffers is 'big endian'.  It's
enough for most standard protocols, but some protocols uses little endian by
default.  There are a few ways to support 'default byte order':

[ ]: Provide a filter that changer the order.
[ ]: Provide getDefaultByteOrder() method in ProtocolCodecFactory
[ ]: Provide getDefaultByteOrder() method in ProtocolEncoder and
ProtocolDecoder
[ ]: We don't need one.

What would be most useful for us?

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: [poll] Where to set the default byte order?

Posted by Trustin Lee <tr...@gmail.com>.
On 8/3/06, Julien Vermillard <jv...@archean.fr> wrote:
>
> I think it's protocolDecoder business. Usualy I change ByteOrder in the
> ProtocolDecoder.decode(..) first lines. I like to have BigEndian by
> default, and change to LittleEndian on tricky protocols.


Oh yeah, for now we don't have any control over the buffer creation in
ProtocolEncoder.  How silly I am!

And the LOC is much less than adding an extra method.  Great point.

Thanks,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: [poll] Where to set the default byte order?

Posted by Julien Vermillard <jv...@archean.fr>.
I think it's protocolDecoder business. Usualy I change ByteOrder in the
ProtocolDecoder.decode(..) first lines. I like to have BigEndian by
default, and change to LittleEndian on tricky protocols.

[X]: We don't need one.

Le jeudi 03 août 2006 à 16:41 +0900, Trustin Lee a écrit :
> On 8/3/06, Trustin Lee <tr...@gmail.com> wrote:
> >
> > [X]: Provide getDefaultByteOrder() method in ProtocolEncoder and
> > ProtocolDecoder
> >
> 
> I chose this because putting getDefaultByteOrder() in ProtocolCodecFactory
> doesn't actually perform any encoding / decoding and only encoder and
> decoder themselves know what order they will use.  Providing a filter is
> also a viable option but I cannot imagine any other use case than what
> getDefaultByteOrder can do.
> 
> Trustin

Re: [poll] Where to set the default byte order?

Posted by Trustin Lee <tr...@gmail.com>.
On 8/3/06, Trustin Lee <tr...@gmail.com> wrote:
>
> [X]: Provide getDefaultByteOrder() method in ProtocolEncoder and
> ProtocolDecoder
>

I chose this because putting getDefaultByteOrder() in ProtocolCodecFactory
doesn't actually perform any encoding / decoding and only encoder and
decoder themselves know what order they will use.  Providing a filter is
also a viable option but I cannot imagine any other use case than what
getDefaultByteOrder can do.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6