Class UnixFSCircularBlockBuffer

java.lang.Object
dev.getelements.elements.rt.transact.unix.UnixFSCircularBlockBuffer

public class UnixFSCircularBlockBuffer extends Object
Given a ByteBuffer, this slices the buffer into a series of smaller ByteBuffers which represent a subset of the data. This allows a ByteBuffer to be used by several threads w/ exclusive access to subsections of the content. While this structure's behavior is thread safe, care must be taken by the client code to ensure that the data contained in the block buffer is mutated appropriately. Specifically each UnixFSCircularBlockBuffer.Slice instance returend by this UnixFSCircularBlockBuffer is not thread safe. Therefore, additional steps must be taken to ensure predictable behavior when dealing with the individual UnixFSCircularBlockBuffer.Slices of this buffer. The UnixFSCircularBlockBuffer.View.stream() UnixFSCircularBlockBuffer.View.reverse() methods of this class uses a snapshot of the trailing/leading values and it is possible that data has changed while iterating. Therefore, code using an iterator must be prepared to handle such scenarios.