Memory-mapped files in Java

后端 未结 4 379
长发绾君心
长发绾君心 2020-12-16 03:52

I\'ve been trying to write some very fast Java code that has to do a lot of I/O. I\'m using a memory mapped file that returns a ByteBuffer:

public static Byt         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 04:35

    Using the ByteBuffer.wrap() functionality does not impose a high burden. It allocates a simple object and initializes a few integers. Writing your algorithm against ByteBuffer is thus your best bet if you need to work with read only files.

提交回复
热议问题