Netty and ByteOrder

我怕爱的太早我们不能终老 提交于 2019-12-21 17:04:14

问题


Due to poor documentation and lack of experience with Netty, i faced with little problem. I have no clue how can i set a default ByteOrder.

I need a Little-Endian set by default. I'll be glad, if someone will give me some hints about this.


回答1:


You could use Bootstrap.setOption() to do this.

    serverBootstrap.setOption("child.bufferFactory", new
HeapChannelBufferFactory(ByteOrder.LITTLE_ENDIAN));
    ... or ...
    clientBootstrap.setOption("bufferFactory", new
HeapChannelBufferFactory(ByteOrder.LITTLE_ENDIAN));


来源:https://stackoverflow.com/questions/9758537/netty-and-byteorder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!