Class BufferChannelFile

java.lang.Object
org.apache.jena.tdb1.base.file.BufferChannelFile
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync, BufferChannel

public class BufferChannelFile extends Object implements BufferChannel
  • Method Details

    • create

      public static BufferChannelFile create(String filename)
      Create a BufferChannelFile
    • createUnmanaged

      public static BufferChannelFile createUnmanaged(String filename, String mode)
      Create a BufferChannelFile with unmanaged file resources - use with care
    • duplicate

      public BufferChannel duplicate()
      Description copied from interface: BufferChannel
      Return another channel to the same storage but with independent position. Chaos may result due to concurrent use.
      Specified by:
      duplicate in interface BufferChannel
    • position

      public long position()
      Description copied from interface: BufferChannel
      return the position
      Specified by:
      position in interface BufferChannel
    • position

      public void position(long pos)
      Description copied from interface: BufferChannel
      set the position
      Specified by:
      position in interface BufferChannel
    • truncate

      public void truncate(long length)
      Description copied from interface: BufferChannel
      Truncate the file.
      Specified by:
      truncate in interface BufferChannel
      See Also:
    • read

      public int read(ByteBuffer buffer)
      Description copied from interface: BufferChannel
      Read into a ByteBuffer. Returns the number of bytes read. -1 for end of file.
      Specified by:
      read in interface BufferChannel
    • read

      public int read(ByteBuffer buffer, long loc)
      Description copied from interface: BufferChannel
      Read into a ByteBuffer, starting at position loc. Return the number of bytes read. loc must be within the file.
      Specified by:
      read in interface BufferChannel
    • write

      public int write(ByteBuffer buffer)
      Description copied from interface: BufferChannel
      Write from ByteBuffer, starting at position loc. Return the number of bytes written
      Specified by:
      write in interface BufferChannel
    • write

      public int write(ByteBuffer buffer, long loc)
      Description copied from interface: BufferChannel
      Write from ByteBuffer, starting at position loc. Return the number of bytes written. loc must be within 0 to length - writing at length is append
      Specified by:
      write in interface BufferChannel
    • size

      public long size()
      Description copied from interface: BufferChannel
      Length of storage, in bytes.
      Specified by:
      size in interface BufferChannel
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: BufferChannel
      Is it empty?
      Specified by:
      isEmpty in interface BufferChannel
    • sync

      public void sync()
      Specified by:
      sync in interface org.apache.jena.atlas.lib.Sync
    • close

      public void close()
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable
    • getLabel

      public String getLabel()
      Description copied from interface: BufferChannel
      useful display string
      Specified by:
      getLabel in interface BufferChannel
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFilename

      public String getFilename()
      Description copied from interface: BufferChannel
      Filename for this BufferChannel (maybe null)
      Specified by:
      getFilename in interface BufferChannel