public class HeapBytesStore<Underlying> extends Object implements BytesStore<HeapBytesStore<Underlying>,Underlying>
charToString| 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) |
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
|
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
default long |
readRemaining() |
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() |
default long |
start() |
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) |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, charAt, contentEquals, copyTo, copyTo, endsWith, equalBytes, from, inside, isClear, length, longCheckSum, nativePointer, realCapacity, safeLimit, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, zeroOutaddAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, findByte, parseLong, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBufferappend, write, write, writeBoolean, writeByte, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloatclose, release, releaseAll, tryReservecloseQuietly, notifyClosingchars, codePointspublic void init(@NotNull
ByteBuffer byteBuffer)
public void init(@NotNull
byte[] byteArray)
public void uninit()
public static <T> HeapBytesStore<T> uninitialized()
@NotNull public String toString()
toString in interface CharSequencetoString in class Object@NotNull public BytesStore<HeapBytesStore<Underlying>,Underlying> copy()
copy in interface BytesStore<HeapBytesStore<Underlying>,Underlying>public void reserve()
reserve in interface net.openhft.chronicle.core.ReferenceCountedpublic void release()
release in interface net.openhft.chronicle.core.ReferenceCountedpublic long refCount()
refCount in interface net.openhft.chronicle.core.ReferenceCountedpublic long capacity()
capacity in interface BytesStore<HeapBytesStore<Underlying>,Underlying>@NotNull public Underlying underlyingObject()
underlyingObject in interface BytesStore<HeapBytesStore<Underlying>,Underlying>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
RandomDataInputreadByte in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readShort(long offset)
throws BufferUnderflowException
RandomDataInputreadShort in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readInt(long offset)
throws BufferUnderflowException
RandomDataInputreadInt in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readLong(long offset)
throws BufferUnderflowException
RandomDataInputreadLong in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic float readFloat(long offset)
throws BufferUnderflowException
RandomDataInputreadFloat in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic double readDouble(long offset)
throws BufferUnderflowException
RandomDataInputreadDouble in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic byte readVolatileByte(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileByte in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileShort in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileInt in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileLong in interface RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the Bytes@NotNull public HeapBytesStore<Underlying> writeByte(long offset, byte b) throws BufferOverflowException
RandomDataOutputwriteByte in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write tob - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeShort(long offset, short i16) throws BufferOverflowException
RandomDataOutputwriteShort in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write toi16 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeInt(long offset, int i32) throws BufferOverflowException
RandomDataOutputwriteInt in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write toi32 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedInt(long offset, int i32) throws BufferOverflowException
RandomDataOutputwriteOrderedInt in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write toi32 - value to writeBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeLong(long offset, long i64) throws BufferOverflowException
RandomDataOutputwriteLong in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write toi64 - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutputwriteOrderedLong in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write toi - value to writeBufferOverflowException@NotNull public HeapBytesStore<Underlying> writeFloat(long offset, float f) throws BufferOverflowException
RandomDataOutputwriteFloat in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write tof - the valueBufferOverflowException - if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutputwriteDouble in interface RandomDataOutput<HeapBytesStore<Underlying>>offset - to write tod - the valueBufferOverflowException - if the capacity was exceededpublic HeapBytesStore<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
writeVolatileByte in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowExceptionpublic HeapBytesStore<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException
writeVolatileShort in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowExceptionpublic HeapBytesStore<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException
writeVolatileInt in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowExceptionpublic HeapBytesStore<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException
writeVolatileLong in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowException@NotNull public HeapBytesStore<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException
write in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowExceptionpublic void write(long offsetInRDO,
@NotNull
ByteBuffer bytes,
int offset,
int length)
throws BufferOverflowException
write in interface RandomDataOutput<HeapBytesStore<Underlying>>BufferOverflowException@NotNull public HeapBytesStore<Underlying> write(long offsetInRDO, RandomDataInput bytes, long offset, long length)
write in interface RandomDataOutput<HeapBytesStore<Underlying>>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)
RandomDataInputnativeRead in interface RandomDataInputposition - within the ByteStore to copy.address - in native memorysize - in bytespublic void nativeWrite(long address,
long position,
long size)
RandomDataOutputnativeWrite in interface RandomDataOutput<HeapBytesStore<Underlying>>address - in native memory to copy fromposition - in BytesStore to copy tosize - in bytespublic long start()
public long readPosition()
public long writePosition()
public long readRemaining()
public long writeRemaining()
public long readLimit()
public long writeLimit()
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset,
float expected,
float value)
throws BufferOverflowException,
IllegalArgumentException,
net.openhft.chronicle.core.io.IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic boolean compareAndSwapDouble(long offset,
double expected,
double value)
throws BufferOverflowException,
IllegalArgumentException,
net.openhft.chronicle.core.io.IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionCopyright © 2015. All rights reserved.