/** * Map a range of a file and return the address at which the range begins. * * @param fileChannel to be mapped. * @param mode for the mapped region. * @param offset within the file the mapped region should start. * @param length of the mapped region. * @return the address at which the mapping starts. */ public static long map( final FileChannel fileChannel, final FileChannel.MapMode mode, final long offset, final long length) { try { return (long)MAP_ADDRESS.invoke(fileChannel, getMode(mode), offset, length); } catch (final IllegalAccessException | InvocationTargetException ex) { LangUtil.rethrowUnchecked(ex); } return 0; }
/** * Map a range of a file and return the address at which the range begins. * * @param fileChannel to be mapped. * @param mode for the mapped region. * @param offset within the file the mapped region should start. * @param length of the mapped region. * @return the address at which the mapping starts. */ public static long map( final FileChannel fileChannel, final FileChannel.MapMode mode, final long offset, final long length) { try { return (long)MAP_ADDRESS.invoke(fileChannel, getMode(mode), offset, length); } catch (final IllegalAccessException | InvocationTargetException ex) { LangUtil.rethrowUnchecked(ex); } return 0; }
/** * Map a range of a file and return the address at which the range begins. * * @param fileChannel to be mapped. * @param mode for the mapped region. * @param offset within the file the mapped region should start. * @param length of the mapped region. * @return the address at which the mapping starts. */ public static long map( final FileChannel fileChannel, final FileChannel.MapMode mode, final long offset, final long length) { try { return (long)MAP_ADDRESS.invoke(fileChannel, getMode(mode), offset, length); } catch (final IllegalAccessException | InvocationTargetException ex) { LangUtil.rethrowUnchecked(ex); } return 0; }