public interface StreamingCommon<S extends StreamingCommon<S>>
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
default long |
addressForRead(long offset,
int buffer) |
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
default ByteOrder |
byteOrder() |
Bytes |
bytesForRead() |
Bytes |
bytesForWrite() |
default long |
capacity() |
S |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
default boolean |
compareAndSwapDouble(long offset,
double expected,
double value)
Perform a 64-bit double CAS at a given offset.
|
default boolean |
compareAndSwapFloat(long offset,
float expected,
float value)
Perform a 32-bit float CAS at a given offset.
|
boolean |
compareAndSwapInt(long offset,
int expected,
int value)
Perform a 32-bit CAS at a given offset.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
boolean |
isDirectMemory() |
default long |
readLimit() |
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
default long |
readRemaining() |
boolean |
sharedMemory() |
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
default long |
writeLimit() |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default long |
writeRemaining() |
@NotNull S clear()
default long start()
default long capacity()
default long readPosition()
default long writePosition()
default long readRemaining()
default long writeRemaining()
default long readLimit()
default long writeLimit()
long addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferUnderflowException
- if the offset is before the start() or the after the capacity()default long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferOverflowException
- if the offset is before the start() or the after the capacity()default ByteOrder byteOrder()
@NotNull Bytes bytesForRead() throws IllegalStateException
IllegalStateException
@NotNull Bytes bytesForWrite() throws IllegalStateException
IllegalStateException
boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
void testAndSetInt(long offset, int expected, int value)
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2018. All rights reserved.