public class HeapBytesStore<Underlying> extends AbstractBytesStore<HeapBytesStore<Underlying>,Underlying>
charToString| Constructor and Description |
|---|
HeapBytesStore() |
| Modifier and Type | Method and Description |
|---|---|
long |
address(long offset)
Obtain the underlying address.
|
default ByteOrder |
byteOrder() |
long |
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.
|
BytesStore<HeapBytesStore<Underlying>,Underlying> |
copy() |
boolean |
equals(Object obj) |
void |
init(byte[] byteArray) |
void |
init(ByteBuffer byteBuffer) |
boolean |
isDirectMemory() |
void |
move(long from,
long to,
long length) |
void |
nativeRead(long position,
long address,
long size)
expert level method for copying data to native memory.
|
void |
nativeWrite(long address,
long position,
long size)
expert level method to copy data from native memory into the BytesStore
|
byte |
readByte(long offset)
Read byte at an offset
|
double |
readDouble(long offset)
Read a double at an offset
|
float |
readFloat(long offset)
Read a float at an offset
|
int |
readInt(long offset)
Read an int at an offset
|
default long |
readLimit() |
long |
readLong(long offset)
Read a long at an offset
|
short |
readShort(long offset)
Read a short at an offset
|
byte |
readVolatileByte(long offset)
Read a 8-bit byte from memory with a load barrier.
|
int |
readVolatileInt(long offset)
Read a 32-bit int from memory with a load barrier.
|
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
short |
readVolatileShort(long offset)
Read a 16-bit short from memory with a load barrier.
|
long |
refCount() |
void |
release() |
void |
reserve() |
boolean |
sharedMemory() |
String |
toString() |
Underlying |
underlyingObject() |
void |
uninit() |
static <T> HeapBytesStore<T> |
uninitialized() |
HeapBytesStore<Underlying> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length) |
HeapBytesStore<Underlying> |
write(long offsetInRDO,
RandomDataInput bytes,
long offset,
long length) |
HeapBytesStore<Underlying> |
writeByte(long offset,
byte b)
Write an unsigned byte at an offset.
|
HeapBytesStore<Underlying> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
HeapBytesStore<Underlying> |
writeFloat(long offset,
float f)
Write a float at an offset.
|
HeapBytesStore<Underlying> |
writeInt(long offset,
int i32)
Write an int at an offset.
|
default long |
writeLimit() |
HeapBytesStore<Underlying> |
writeLong(long offset,
long i64)
Write a long at an offset.
|
HeapBytesStore<Underlying> |
writeOrderedInt(long offset,
int i32)
Perform a non stalling write with a store barrier.
|
HeapBytesStore<Underlying> |
writeOrderedLong(long offset,
long i)
Perform a non stalling write with a store barrier.
|
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default long |
writeRemaining() |
HeapBytesStore<Underlying> |
writeShort(long offset,
short i16)
Write a short at an offset.
|
HeapBytesStore<Underlying> |
writeVolatileByte(long offset,
byte i8) |
HeapBytesStore<Underlying> |
writeVolatileInt(long offset,
int i32) |
HeapBytesStore<Underlying> |
writeVolatileLong(long offset,
long i64) |
HeapBytesStore<Underlying> |
writeVolatileShort(long offset,
short i16) |
hashCode, peekUnsignedByte, readPosition, readRemaining, startclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, charAt, cipher, cipher, contentEquals, copyTo, copyTo, empty, endsWith, equalBytes, from, inside, isClear, isEmpty, isPresent, isPresent, length, longCheckSum, nativePointer, readWrite, realCapacity, safeLimit, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, writeMaxLong, zeroOutaddAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBufferappend, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloatrelease, releaseAll, tryReservechars, codePoints@NotNull public static <T> HeapBytesStore<T> uninitialized()
public boolean isDirectMemory()
public void init(@NotNull
ByteBuffer byteBuffer)
public void init(@NotNull
byte[] byteArray)
public void uninit()
public void move(long from,
long to,
long length)
@NotNull public String toString()
toString in interface CharSequencetoString in class Object@NotNull public BytesStore<HeapBytesStore<Underlying>,Underlying> copy()
public void reserve()
public void release()
public long refCount()
public long capacity()
@NotNull public Underlying underlyingObject()
public boolean compareAndSwapInt(long offset,
int expected,
int value)
offset - to perform CASexpected - valuevalue - to setpublic boolean compareAndSwapLong(long offset,
long expected,
long value)
offset - to perform CASexpected - valuevalue - to setpublic byte readByte(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readShort(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readInt(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readLong(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic float readFloat(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic double readDouble(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic byte readVolatileByte(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset)
throws BufferUnderflowException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytes@NotNull public HeapBytesStore<Underlying> writeByte(long offset, byte b) throws BufferOverflowException
RandomDataOutputoffset - to write tob - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeShort(long offset, short i16) throws BufferOverflowException
RandomDataOutputoffset - to write toi16 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeInt(long offset, int i32) throws BufferOverflowException
RandomDataOutputoffset - to write toi32 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedInt(long offset, int i32) throws BufferOverflowException
RandomDataOutputoffset - to write toi32 - value to writeBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeLong(long offset, long i64) throws BufferOverflowException
RandomDataOutputoffset - to write toi64 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutputoffset - to write toi - value to writeBufferOverflowException@NotNull public HeapBytesStore<Underlying> writeFloat(long offset, float f) throws BufferOverflowException
RandomDataOutputoffset - to write tof - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutputoffset - to write tod - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
BufferOverflowException@NotNull public HeapBytesStore<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException
BufferOverflowException@NotNull public HeapBytesStore<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException
BufferOverflowException@NotNull public HeapBytesStore<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException
BufferOverflowException@NotNull public HeapBytesStore<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException
BufferOverflowExceptionpublic void write(long offsetInRDO,
@NotNull
ByteBuffer bytes,
int offset,
int length)
throws BufferOverflowException
BufferOverflowException@NotNull public HeapBytesStore<Underlying> write(long offsetInRDO, @NotNull RandomDataInput bytes, long offset, long length)
public long address(long offset)
throws UnsupportedOperationException
offset - within this buffer. address(start()) is the actual address of the first byte.UnsupportedOperationException - if the underlying buffer is on the heappublic void nativeRead(long position,
long address,
long size)
RandomDataInputposition - within the ByteStore to copy.address - in native memorysize - in bytespublic void nativeWrite(long address,
long position,
long size)
RandomDataOutputaddress - in native memory to copy fromposition - in BytesStore to copy tosize - in bytespublic boolean sharedMemory()
public long writePosition()
public long writeRemaining()
public long readLimit()
public long writeLimit()
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset,
float expected,
float value)
throws BufferOverflowException,
IllegalArgumentException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionpublic boolean compareAndSwapDouble(long offset,
double expected,
double value)
throws BufferOverflowException,
IllegalArgumentException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionCopyright © 2017. All rights reserved.