jdk nio bytebuffer 和 netty bytebuf 的区别

区别点:

1、Bytebuffer只有一个index读写公用,写模式到读模式转换需要 flip(),设置index值;Bytebuf有读写两个index,模式转换不用flip()

2、Bytebuf写入数据超出申请字节长度 可以扩容;Bytebuffer不能扩容

https://www.jianshu.com/p/8e407689c15a——Bytebuf

https://blog.csdn.net/mrliuzhao/article/details/89453082——Bytebuffer

猜你喜欢

转载自blog.csdn.net/weixin_42226343/article/details/104164069