private byte [ ] getDiskBytes ( long offset ) throws IOException { mappedFile . seek ( dataOffset + offset ) ; //Get size of data int size = LongPacker . unpackInt ( mappedFile ) ; //Create output bytes byte [ ] res = new byte [ size ] ; //Read data if ( mappedFile . read ( res ) == - 1 ) { throw new EOFException ( ) ; } return res ; }
Get data from disk