FileChannel fc = new RandomAccessFile(fileName, "rw").getChannel(); // Map 8 bytes for long value. mem = fc.map(FileChannel.MapMode.READ_WRITE, 0, 8); startAddress = ((DirectBuffer) mem).address();