Why Java NIO introduces Buffer class specially rather than using array?
问题 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