Class SegmentedMemBuffer

java.lang.Object
org.apache.jena.dboe.base.file.SegmentedMemBuffer

public class SegmentedMemBuffer extends Object
A segmented, expanding buffer of bytes. This class does not copy the underlying bytes when the file grows. Hence, the performance is more predictable. (Resizing a fixed size buffer is a copy c.f. performance issues with ArrayList or ByteArrayOutputStream as they go from small to large.
  • Constructor Details

    • SegmentedMemBuffer

      public SegmentedMemBuffer()
    • SegmentedMemBuffer

      public SegmentedMemBuffer(int chunk)
  • Method Details

    • open

      public void open()
    • isOpen

      public boolean isOpen()
    • read

      public int read(long posn, ByteBuffer bb)
    • read

      public int read(long posn, byte[] b)
    • read

      public int read(long posn, byte[] b, int start, int length)
    • write

      public void write(long posn, ByteBuffer bb)
    • write

      public void write(long posn, byte[] b)
    • write

      public void write(long posn, byte[] b, int start, int length)
    • truncate

      public void truncate(long length)
    • sync

      public void sync()
    • close

      public void close()
    • length

      public long length()