endianness - Little-endian support in Netty 4 -


the new & noteworthy docs 4 state support -ness has changed significantly, going on show use of bytebuf.order(). whilst that's useful localised use within channel handlers, whole downstream pipeline use little-endian buffers.

the upstream handler lengthfieldbasedframedecoder takes constructor argument byte order, downstream handler lengthfieldprepender not. appears support configuration-driven replacement of buffer factories has gone netty 4, how should arrive @ complete little-endian downstream pipeline?

i did this, though feels awfully hacky:

https://gist.github.com/thomaslee/7871444

if wire in pipeline after lengthfieldprepender run, rewrite (big endian) length field using little endian byte ordering.

probably more efficient write length in little endian after measuring length of in & dropping lengthfieldprepender entirely rather adding step pipeline code has been lazily copied & can attest working. :)

i love know if there's better solution beyond hand-rolling stuff in 4.x.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -