Package org.apache.jena.dboe.base.file
Class SegmentedMemBuffer
java.lang.Object
org.apache.jena.dboe.base.file.SegmentedMemBuffer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisOpen()longlength()voidopen()intread(long posn, byte[] b) intread(long posn, byte[] b, int start, int length) intread(long posn, ByteBuffer bb) voidsync()voidtruncate(long length) voidwrite(long posn, byte[] b) voidwrite(long posn, byte[] b, int start, int length) voidwrite(long posn, ByteBuffer bb)
-
Constructor Details
-
SegmentedMemBuffer
public SegmentedMemBuffer() -
SegmentedMemBuffer
public SegmentedMemBuffer(int chunk)
-
-
Method Details
-
open
public void open() -
isOpen
public boolean isOpen() -
read
-
read
public int read(long posn, byte[] b) -
read
public int read(long posn, byte[] b, int start, int length) -
write
-
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()
-