public class ExpectedBytesStore<B extends BytesStore<B,Underlying>,Underlying> extends Object implements BytesStore<B,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<B,Underlying> |
copy() |
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
|
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
|
long |
refCount() |
void |
release() |
void |
reserve() |
boolean |
sharedMemory() |
default long |
start() |
Underlying |
underlyingObject() |
B |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length) |
B |
write(long offsetInRDO,
RandomDataInput bytes,
long offset,
long length) |
B |
writeByte(long offset,
byte i8)
Write an unsigned byte at an offset.
|
B |
writeDouble(long offset,
double d)
Write a double at an offset.
|
B |
writeFloat(long offset,
float d)
Write a float at an offset.
|
B |
writeInt(long offset,
int i)
Write an int at an offset.
|
default long |
writeLimit() |
B |
writeLong(long offset,
long i)
Write a long at an offset.
|
B |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
B |
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() |
B |
writeShort(long offset,
short i)
Write a short at an offset.
|
B |
writeVolatileByte(long offset,
byte i8) |
B |
writeVolatileInt(long offset,
int i32) |
B |
writeVolatileLong(long offset,
long i64) |
B |
writeVolatileShort(long offset,
short i16) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, charAt, contentEquals, copyTo, copyTo, empty, endsWith, equalBytes, from, inside, isClear, isNative, isPresent, isPresent, length, longCheckSum, nativePointer, realCapacity, safeLimit, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, wrap, writeMaxLong, zeroOut
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, findByte, parseLong, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileByte, readVolatileDouble, readVolatileFloat, readVolatileInt, readVolatileLong, readVolatileShort, subBytes, toByteArray, toTemporaryDirectByteBuffer
append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
close, release, releaseAll, tryReserve
closeQuietly, isClosed, notifyClosing
chars, codePoints, toString
@NotNull public BytesStore<B,Underlying> copy()
copy
in interface BytesStore<B extends BytesStore<B,Underlying>,Underlying>
public long capacity()
capacity
in interface BytesStore<B extends BytesStore<B,Underlying>,Underlying>
@Nullable public Underlying underlyingObject()
underlyingObject
in interface BytesStore<B extends BytesStore<B,Underlying>,Underlying>
public void nativeWrite(long address, long position, long size)
RandomDataOutput
nativeWrite
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytespublic void nativeRead(long position, long address, long size)
RandomDataInput
nativeRead
in interface RandomDataInput
position
- within the ByteStore to copy.address
- in native memorysize
- in bytespublic 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)
RandomDataInput
readByte
in interface RandomDataInput
offset
- to readpublic short readShort(long offset)
RandomDataInput
readShort
in interface RandomDataInput
offset
- to readpublic int readInt(long offset)
RandomDataInput
readInt
in interface RandomDataInput
offset
- to readpublic long readLong(long offset)
RandomDataInput
readLong
in interface RandomDataInput
offset
- to readpublic float readFloat(long offset)
RandomDataInput
readFloat
in interface RandomDataInput
offset
- to readpublic double readDouble(long offset)
RandomDataInput
readDouble
in interface RandomDataInput
offset
- to read@NotNull public B writeByte(long offset, byte i8) throws AssertionError
RandomDataOutput
writeByte
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi8
- the valueAssertionError
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 heap@NotNull public B writeShort(long offset, short i) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeShort
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi
- the valueIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public B writeInt(long offset, int i) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeInt
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi
- the valueIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
public void reserve() throws IllegalStateException
reserve
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
@NotNull public B writeOrderedInt(long offset, int i) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi
- value to writeIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
public void release() throws IllegalStateException
release
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
@NotNull public B writeLong(long offset, long i) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeLong
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi
- the valueIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
public long refCount()
refCount
in interface net.openhft.chronicle.core.ReferenceCounted
@NotNull public B writeOrderedLong(long offset, long i) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write toi
- value to writeAssertionError
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public B writeFloat(long offset, float d) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeFloat
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write tod
- the valueIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public B writeDouble(long offset, double d) throws AssertionError, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeDouble
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
offset
- to write tod
- the valueIORuntimeException
- if the underlying buffer fails to resize.AssertionError
net.openhft.chronicle.core.io.IORuntimeException
public B writeVolatileByte(long offset, byte i8) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileByte
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public B writeVolatileShort(long offset, short i16) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileShort
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public B writeVolatileInt(long offset, int i32) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileInt
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public B writeVolatileLong(long offset, long i64) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileLong
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public B write(long offsetInRDO, byte[] bytes, int offset, int length) throws AssertionError, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
AssertionError
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length)
write
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
@NotNull public B write(long offsetInRDO, RandomDataInput bytes, long offset, long length)
write
in interface RandomDataOutput<B extends BytesStore<B,Underlying>>
public void move(long from, long to, long length)
move
in interface BytesStore<B extends BytesStore<B,Underlying>,Underlying>
public boolean sharedMemory()
public 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 setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
Copyright © 2016. All rights reserved.