public class HeapBytesStore<Underlying> extends AbstractBytesStore<HeapBytesStore<Underlying>,Underlying>
charToString
Constructor and Description |
---|
HeapBytesStore() |
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() |
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() |
void |
testAndSetInt(long offset,
int expected,
int value) |
String |
toString() |
boolean |
tryReserve() |
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 writeOffset,
RandomDataInput bytes,
long readOffset,
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, start
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, charAt, cipher, cipher, contentEquals, copyTo, copyTo, empty, endsWith, equalBytes, from, inside, inside, isClear, isEmpty, isPresent, isPresent, length, longCheckSum, nativePointer, readWrite, realCapacity, safeLimit, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, writeMaxLong, zeroOut
addAndGetDouble, 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, toTemporaryDirectByteBuffer
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, 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 CharSequence
toString
in class Object
@NotNull public BytesStore<HeapBytesStore<Underlying>,Underlying> copy()
public void reserve()
public void release()
public long refCount()
public boolean tryReserve()
public long capacity()
@NotNull public Underlying underlyingObject()
public boolean compareAndSwapInt(long offset, int expected, int value)
offset
- to perform CASexpected
- valuevalue
- to setpublic void testAndSetInt(long offset, int expected, int value)
public boolean compareAndSwapLong(long offset, long expected, long value)
offset
- to perform CASexpected
- valuevalue
- to setpublic byte readByte(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic short readShort(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int readInt(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readLong(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic float readFloat(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic double readDouble(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic byte readVolatileByte(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset) throws BufferUnderflowException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytes@NotNull public HeapBytesStore<Underlying> writeByte(long offset, byte b) throws BufferOverflowException
RandomDataOutput
offset
- to write tob
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeShort(long offset, short i16) throws BufferOverflowException
RandomDataOutput
offset
- to write toi16
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeInt(long offset, int i32) throws BufferOverflowException
RandomDataOutput
offset
- to write toi32
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedInt(long offset, int i32) throws BufferOverflowException
RandomDataOutput
offset
- to write toi32
- value to writeBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeLong(long offset, long i64) throws BufferOverflowException
RandomDataOutput
offset
- to write toi64
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutput
offset
- to write toi
- value to writeBufferOverflowException
@NotNull public HeapBytesStore<Underlying> writeFloat(long offset, float f) throws BufferOverflowException
RandomDataOutput
offset
- to write tof
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public HeapBytesStore<Underlying> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutput
offset
- 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
BufferOverflowException
public void write(long offsetInRDO, @NotNull ByteBuffer bytes, int offset, int length) throws BufferOverflowException
BufferOverflowException
@NotNull public HeapBytesStore<Underlying> write(long writeOffset, @NotNull RandomDataInput bytes, long readOffset, long length)
public long addressForRead(long offset) throws UnsupportedOperationException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heappublic long addressForWrite(long offset) throws UnsupportedOperationException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heappublic void nativeRead(long position, long address, long size)
RandomDataInput
position
- within the ByteStore to copy.address
- in native memorysize
- in bytespublic void nativeWrite(long address, long position, long size)
RandomDataOutput
address
- 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 long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
Copyright © 2018. All rights reserved.