DirectByteBuffer in Java
MappedByteBuffer is a way to read and write binary files directly in Java. It allows you to address file data at the bytes level, so it is convenient and potentially high performance. It maps a file region into the virtual address space of the Java process. Here's a simple example of how to use it (also on GitHub ): public class MappedByteBufferTest { public static void main(String[] args) throws IOException { //WRITE FILE int len = 200; RandomAccessFile file = new RandomAccessFile("output.txt", "rw"); MappedByteBuffer outputBuffer = file.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, len); for (int i = 0; i < len; i++) outputBuffer.put((byte) i);...