对于allocate()或allocateDirect(),这就是问题所在。
allocate()
allocateDirect()
多年来,我一直认为,由于DirectByteBuffers是操作系统级别的直接内存映射,因此使用get/put调用会比HeapByteBuffers执行得更快。直到现在,我才真正有兴趣找出有关这种情况的确切细节。我想知道两种类型的ByteBuffer中哪一种更快,以及在什么条件下。
DirectByteBuffer
HeapByteBuffer
ByteBuffer
https://stackoverflow.com/questions/5670862
相似问题