Package org.apache.jena.dboe.base.file
Class SegmentedMemBuffer
- java.lang.Object
-
- org.apache.jena.dboe.base.file.SegmentedMemBuffer
-
public class SegmentedMemBuffer extends java.lang.ObjectA 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 withArrayListorByteArrayOutputStreamas they go from small to large.
-
-
Constructor Summary
Constructors Constructor Description SegmentedMemBuffer()SegmentedMemBuffer(int chunk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisOpen()longlength()voidopen()intread(long posn, byte[] b)intread(long posn, byte[] b, int start, int length)intread(long posn, java.nio.ByteBuffer bb)voidsync()voidtruncate(long length)voidwrite(long posn, byte[] b)voidwrite(long posn, byte[] b, int start, int length)voidwrite(long posn, java.nio.ByteBuffer bb)
-
-
-
Method Detail
-
open
public void open()
-
isOpen
public boolean isOpen()
-
read
public int read(long posn, java.nio.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, java.nio.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()
-
-