Class MemoryMappedFile
- java.lang.Object
-
- net.haesleinhuepf.clij.coremem.memmap.MemoryMappedFile
-
- All Implemented Interfaces:
AutoCloseable,Cleanable
public class MemoryMappedFile extends Object implements AutoCloseable, Cleanable
- Author:
- royer
-
-
Constructor Summary
Constructors Constructor Description MemoryMappedFile(FileChannel pFileChannel, MemoryMappedFileAccessMode pAccessMode, long pFilePosition, long pMappedRegionLength, boolean pExtendIfNeeded)Instanciates a memory mapped file for a given file channel, access mode, file position, mapped region length, and 'extend-if-needed' flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetAddressAtFilePosition(long pFilePosition)CleanergetCleaner()Returns the cleaner for this object.
-
-
-
Constructor Detail
-
MemoryMappedFile
public MemoryMappedFile(FileChannel pFileChannel, MemoryMappedFileAccessMode pAccessMode, long pFilePosition, long pMappedRegionLength, boolean pExtendIfNeeded)
Instanciates a memory mapped file for a given file channel, access mode, file position, mapped region length, and 'extend-if-needed' flag.- Parameters:
pFileChannel- file channelpAccessMode- access modepFilePosition- file positionpMappedRegionLength- region lengthpExtendIfNeeded- true extend if needed
-
-
Method Detail
-
getAddressAtFilePosition
public long getAddressAtFilePosition(long pFilePosition)
- Parameters:
pFilePosition- file position- Returns:
- address at file position
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
getCleaner
public Cleaner getCleaner()
Description copied from interface:CleanableReturns the cleaner for this object.- Specified by:
getCleanerin interfaceCleanable- Returns:
- cleaner runnable
-
-