This package is not really tied to I/O as its name could suggest. The name
was kept since it mimics (and internally uses) the ByteBuffer
classes of the java.nio
package.
The purpose of this package is to handle memory pools that are not stored in areas managed by the JVM but inside memory zones allocated by native interfaces.
It also allows to transparently define memory zone both usable by JVM/JNI and GCJ/CNI. GCJ allows to compile Java code into machine code like do most compilers, avoiding the use of a virtual machine.
There are six data classes mapping to corresponding Java native types: byte,
short, int, long, float and double. Each as a <Type>Data
class that is implemented either for VMs by a <Type>DataJvm
class or for CNI by a <Type>DataCni
class. This makes a
total of 18 classes.
The user never sees the classes suffixed by Jvm
or
Cni
, they are created automatically by the
allocate_direct(int)
method present in each
<Type>Data
class.