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)
Retrieves the underlying memory address for reading.
|
default long |
addressForRead(long offset,
int buffer)
Retrieves the underlying memory address for reading.
|
long |
addressForWrite(long offset)
Retrieves the underlying memory address for writing.
|
long |
addressForWritePosition()
Retrieves the underlying memory address for writing at the current write position.
|
default ByteOrder |
byteOrder()
Retrieves the byte order used by the buffer.
|
protected boolean |
canReleaseInBackground() |
boolean |
equals(Object obj) |
int |
hashCode() |
byte[] |
internalNumberBuffer()
Deprecated.
|
default long |
lengthWritten(long startPosition)
Calculates the length of data written from the given start position.
|
int |
peekUnsignedByte(long offset)
Reads an unsigned byte value from a specific offset.
|
default long |
readLimit()
If the resource is closed, the returned value is unspecified.
|
long |
readPosition()
Returns the read position.
|
long |
readRemaining()
Calculates the number of bytes remaining that can be read from the current read position.
|
default long |
realReadRemaining()
Calculates the number of bytes that can be safely read directly.
|
default long |
realWriteRemaining()
Calculates the number of bytes remaining that can be written from the current write position with resizing.
|
boolean |
sharedMemory()
Checks if the Bytes use shared memory.
|
long |
start() |
default long |
writeLimit()
Retrieves the maximum writable position within the buffer.
|
default long |
writePosition()
Returns the write position.
|
long |
writeRemaining()
Calculates the number of bytes remaining that can be written from the current write position.
|
addReferenceChangeListener, assertReferencesReleased, backgroundPerformRelease, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, performRelease, refCount, referenceCountedUnmonitored, referenceId, release, releaseLast, removeReferenceChangeListener, reserve, reservedBy, reserveTransfer, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, toString, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetDouble, addAndGetDoubleNotAtomic, addAndGetFloat, addAndGetFloatNotAtomic, addAndGetInt, addAndGetIntNotAtomic, addAndGetLong, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, byteCheckSum, byteCheckSum, bytesForRead, bytesForWrite, bytesStore, capacity, charAt, cipher, cipher, compareAndSwapDouble, compareAndSwapFloat, compareAndSwapInt, compareAndSwapLong, contentEquals, copy, copyTo, copyTo, elasticByteBuffer, empty, endsWith, equalBytes, follow, forFields, from, from, from, hash, inside, inside, isClear, isDirectMemory, isEmpty, isEqual, isImmutableEmptyByteStore, lazyNativeBytesStoreWithFixedCapacity, length, move, nativePointer, nativeStore, nativeStoreFrom, nativeStoreWithFixedCapacity, readWrite, realCapacity, safeLimit, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, underlyingObject, wrap, wrap, wrap, writeMaxInt, writeMaxLong, zeroOut
canReadDirect, 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, testAndSetInt, toByteArray, toTemporaryDirectByteBuffer
append, append, appendAndReturnLength, nativeWrite, testAndSetInt, 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
addReferenceChangeListener, refCount, release, releaseLast, releaseLast, removeReferenceChangeListener, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
chars, codePoints, toString
protected AbstractBytesStore()
protected AbstractBytesStore(boolean monitored)
public int peekUnsignedByte(long offset) throws IllegalStateException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- the location from where the unsigned byte value is read.IllegalStateException
- if the byte source has been released.public long readPosition()
The read position is start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
If the resource is closed, the returned value is unspecified.
public long readRemaining()
If the resource is closed, the returned value is unspecified.
public long writeRemaining()
If the resource is closed, the returned value is unspecified.
public long start()
protected boolean canReleaseInBackground()
canReleaseInBackground
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
@Deprecated public byte[] internalNumberBuffer()
internalNumberBuffer
in interface RandomDataOutput<B extends BytesStore<B,U>>
public long writePosition()
The write position is readPosition() <= writePosition() && writePosition() <= writeLimit()
If the resource is closed, the returned value is unspecified.
public long lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
If the resource is closed, the returned value is unspecified.
startPosition
- The position to calculate the length from.public long realReadRemaining()
If the resource is closed, the returned value is unspecified.
public long realWriteRemaining()
If the resource is closed, the returned value is unspecified.
public long readLimit()
If the resource is closed, the returned value is unspecified.
public long writeLimit()
If the resource is closed, the returned value is unspecified.
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
- if the buffer has been closed.public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
offset
- The offset within this buffer.buffer
- The buffer index.UnsupportedOperationException
- if the underlying buffer is on the heap.BufferUnderflowException
- if the offset is before the start or after the capacity.IllegalStateException
- if the buffer has been closed.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
UnsupportedOperationException
- if the underlying buffer is on the heap.BufferOverflowException
- if the current write position is before the start or after the capacity.IllegalStateException
- if the buffer state doesn't allow the operation.public ByteOrder byteOrder()
public boolean sharedMemory()
Copyright © 2023. All rights reserved.