Class FChannelBuffer

java.lang.Object
xyz.cofe.cbuffer.SBCBuffer
xyz.cofe.io.fs.FChannelBuffer
All Implemented Interfaces:
java.lang.AutoCloseable, xyz.cofe.cbuffer.ContentBuffer

public class FChannelBuffer
extends xyz.cofe.cbuffer.SBCBuffer
Файловый буфер с использоавнием канала файла
Author:
user
  • Field Summary

    Fields inherited from class xyz.cofe.cbuffer.SBCBuffer

    channel, closeOnFinalize
  • Constructor Summary

    Constructors 
    Constructor Description
    FChannelBuffer​(java.nio.channels.FileChannel channel)  
  • Method Summary

    Modifier and Type Method Description
    void flush()  
    void force​(boolean metaData)  
    java.nio.channels.FileChannel getFileChannel()  
    java.nio.channels.FileLock lock()  
    java.nio.channels.FileLock lock​(long position, long size, boolean shared)  
    java.nio.MappedByteBuffer map​(java.nio.channels.FileChannel.MapMode mode, long position, long size)  
    static FChannelBuffer open​(java.nio.file.Path path, java.nio.file.OpenOption... options)  
    static FChannelBuffer open​(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)  
    static FChannelBuffer open​(File file, java.nio.file.OpenOption... options)  
    static FChannelBuffer open​(File file, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)  
    long transferFrom​(java.nio.channels.ReadableByteChannel src, long position, long count)  
    long transferTo​(long position, long count, java.nio.channels.WritableByteChannel target)  
    java.nio.channels.FileLock tryLock()  
    java.nio.channels.FileLock tryLock​(long position, long size, boolean shared)  

    Methods inherited from class xyz.cofe.cbuffer.SBCBuffer

    clear, clone, close, finalize, get, getChannel, getSize, set, setSize

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FChannelBuffer

      public FChannelBuffer​(java.nio.channels.FileChannel channel)
  • Method Details

    • open

      public static FChannelBuffer open​(java.nio.file.Path path, java.nio.file.OpenOption... options)
    • open

      public static FChannelBuffer open​(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)
    • open

      public static FChannelBuffer open​(File file, java.nio.file.OpenOption... options)
    • open

      public static FChannelBuffer open​(File file, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)
    • getFileChannel

      public java.nio.channels.FileChannel getFileChannel()
    • lock

      public java.nio.channels.FileLock lock()
    • lock

      public java.nio.channels.FileLock lock​(long position, long size, boolean shared)
    • tryLock

      public java.nio.channels.FileLock tryLock()
    • tryLock

      public java.nio.channels.FileLock tryLock​(long position, long size, boolean shared)
    • force

      public void force​(boolean metaData)
    • flush

      public void flush()
      Specified by:
      flush in interface xyz.cofe.cbuffer.ContentBuffer
      Overrides:
      flush in class xyz.cofe.cbuffer.SBCBuffer
    • map

      public java.nio.MappedByteBuffer map​(java.nio.channels.FileChannel.MapMode mode, long position, long size)
    • transferFrom

      public long transferFrom​(java.nio.channels.ReadableByteChannel src, long position, long count)
    • transferTo

      public long transferTo​(long position, long count, java.nio.channels.WritableByteChannel target)