B
- ByteStore typeU
- Underlying typepublic abstract class AbstractBytesStore<B extends BytesStore<B,U>,U> extends net.openhft.chronicle.core.io.AbstractReferenceCounted implements BytesStore<B,U>
referenceCounted, WARN_COUNT, WARN_NS
charToString
Modifier | Constructor and Description |
---|---|
protected |
AbstractBytesStore() |
protected |
AbstractBytesStore(boolean monitored) |
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.
|
long |
addressForWritePosition() |
default ByteOrder |
byteOrder() |
protected boolean |
canReleaseInBackground() |
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 |
equals(Object obj) |
int |
hashCode() |
default long |
lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
|
int |
peekUnsignedByte(long offset)
Read an unsigned byte at an offset, or -1
|
default long |
readLimit() |
long |
readPosition()
The read position must be
start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit() |
long |
readRemaining() |
default long |
realReadRemaining() |
default long |
realWriteRemaining() |
boolean |
sharedMemory() |
long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
default long |
writeLimit() |
default long |
writePosition()
The write position must be
readPosition() <= writePosition() && writePosition() <= writeLimit() |
long |
writeRemaining() |
assertReferencesReleased, backgroundPerformRelease, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, performRelease, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, byteCheckSum, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, capacity, charAt, cipher, cipher, contentEquals, copy, copyTo, copyTo, elasticByteBuffer, empty, endsWith, equalBytes, forFields, from, from, from, hash, inside, inside, isClear, isDirectMemory, isEmpty, isEqual, lazyNativeBytesStoreWithFixedCapacity, length, move, nativePointer, nativeStore, nativeStoreFrom, nativeStoreWithFixedCapacity, readWrite, realCapacity, safeLimit, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, underlyingObject, wrap, wrap, wrap, writeMaxInt, writeMaxLong, zeroOut
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, canReadDirect, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, nativeRead, parseLong, peekVolatileInt, printable, read, readBoolean, readByte, readDouble, readFloat, readIncompleteLong, readInt, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileByte, readVolatileDouble, readVolatileFloat, readVolatileInt, readVolatileLong, readVolatileShort, subBytes, toByteArray, toTemporaryDirectByteBuffer
append, append, nativeWrite, write, write, write, write, write, write8bit, write8bit, writeBoolean, writeByte, writeByte, writeDouble, writeFloat, writeInt, writeInt24, writeLong, writeOrderedDouble, writeOrderedFloat, writeOrderedInt, writeOrderedLong, writeShort, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileByte, writeVolatileDouble, writeVolatileFloat, writeVolatileInt, writeVolatileLong, writeVolatileShort
refCount, release, releaseLast, releaseLast, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
chars, codePoints, toString
protected AbstractBytesStore()
protected AbstractBytesStore(boolean monitored)
public int peekUnsignedByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic long readPosition()
start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
public long readRemaining()
public long writeRemaining()
public long start()
protected boolean canReleaseInBackground()
canReleaseInBackground
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public long writePosition()
readPosition() <= writePosition() && writePosition() <= writeLimit()
public long lengthWritten(long startPosition)
startPosition
- to compare againstpublic long realReadRemaining()
public long realWriteRemaining()
public long readLimit()
public long writeLimit()
public long addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
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()IllegalStateException
public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
public long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
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()IllegalStateException
public long addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
public ByteOrder byteOrder()
public boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public void testAndSetInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public boolean sharedMemory()
Copyright © 2022. All rights reserved.