本文介绍了净额和字节顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于文档不佳以及缺乏Netty经验,我几乎没有遇到任何问题.我不知道如何设置默认的ByteOrder.

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.

默认情况下,我需要设置 Little-Endian .如果有人能给我一些提示,我会很高兴.

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

推荐答案

您可以使用Bootstrap.setOption()来做到这一点.

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

这篇关于净额和字节顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 15:27