Why Java NIO introduces Buffer class specially rather than using array?

匆匆过客 提交于 2019-12-24 03:01:19

问题


I was asked a question that why a byte array is not enough and NIO specially introduces a class Buffer?

What will be a good answer to this question? Is it only a kind of wrapper class which simplifies the read/write operation ?

If possible, please give us an example to demonstrate how we benefit from Buffer class which can not/hardly be done with an array.

来源:https://stackoverflow.com/questions/27729953/why-java-nio-introduces-buffer-class-specially-rather-than-using-array

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