> Yeah, but also the code shown above used native low level primitives like mmap which typically aren't available.

Native calls are a normal part of Java. And the pointer and word classes used could be implemented using the Unsafe class which is present in Java.