Class MMapBuffer

  • All Implemented Interfaces:
    BufferResource, java.io.Closeable, java.lang.AutoCloseable

    public final class MMapBuffer
    extends java.lang.Object
    implements BufferResource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int PAGE_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      MMapBuffer​(java.io.File file, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
      MMapBuffer​(java.io.File file, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
      MMapBuffer​(java.io.RandomAccessFile raf, java.io.File file, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
      MMapBuffer​(java.io.RandomAccessFile raf, java.io.File file, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order, boolean closeFile)  
      MMapBuffer​(java.io.RandomAccessFile raf, java.nio.file.Path path, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
      MMapBuffer​(java.io.RandomAccessFile raf, java.nio.file.Path path, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order, boolean closeFile)  
      MMapBuffer​(java.nio.file.Path path, long offset, long length, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
      MMapBuffer​(java.nio.file.Path path, java.nio.channels.FileChannel.MapMode mapMode, java.nio.ByteOrder order)  
    • Constructor Detail

      • MMapBuffer

        public MMapBuffer​(java.io.File file,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.io.File file,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.nio.file.Path path,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.nio.file.Path path,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.io.RandomAccessFile raf,
                          java.io.File file,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.io.RandomAccessFile raf,
                          java.nio.file.Path path,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.io.RandomAccessFile raf,
                          java.io.File file,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order,
                          boolean closeFile)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • MMapBuffer

        public MMapBuffer​(java.io.RandomAccessFile raf,
                          java.nio.file.Path path,
                          long offset,
                          long length,
                          java.nio.channels.FileChannel.MapMode mapMode,
                          java.nio.ByteOrder order,
                          boolean closeFile)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • advise

        public void advise​(long position,
                           long length)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • sync

        public void sync​(long position,
                         long length)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • mlock

        public void mlock​(long position,
                          long length)
      • munlock

        public void munlock​(long position,
                            long length)
      • mincore

        public void mincore​(long position,
                            long length,
                            DirectMemory direct)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • isTrackingEnabled

        @Deprecated
        public static boolean isTrackingEnabled()
        Deprecated.
        Returns:
        true, if open buffers tracking is enabled, else false

        DO NOT USE THIS unless you know what you're doing.

      • madviseDontNeedTrackedBuffers

        @Deprecated
        public static void madviseDontNeedTrackedBuffers()
        Deprecated.
        If open buffers tracking is enabled, calls madvise with MADV_DONTNEED for all tracked buffers. If open buffers tracking is disabled, does nothing.

        This can reduce resident set size of the process, but may significantly affect performance. See madvise(2) for more info.

        DO NOT USE THIS unless you know what you're doing.