private void mapAndSetOffset ( ) { try { final RandomAccessFile backingFile = new RandomAccessFile ( this . file , "rw" ) ; backingFile . setLength ( this . size ) ; final FileChannel ch = backingFile . getChannel ( ) ; this . addr = ( Long ) mmap . invoke ( ch , 1 , 0L , this . size ) ; ch . close ( ) ; backingFile . close ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
for the given length and set this . addr to the returned offset