public class ReadOnlyMappedBytesStore extends MappedBytesStore
address, limit, maximumLimit, memory
referenceCounted, WARN_COUNT, WARN_NS
charToString
Constructor and Description |
---|
ReadOnlyMappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
MappedFile mappedFile,
long start,
long address,
long capacity,
long safeCapacity) |
Modifier and Type | Method and Description |
---|---|
default long |
addressForRead(long offset,
int buffer) |
long |
appendUTF(long pos,
char[] chars,
int offset,
int length)
Deprecated.
|
long |
appendUtf8(long pos,
char[] chars,
int offset,
int length) |
default ByteOrder |
byteOrder() |
@NotNull VanillaBytes<Void> |
bytesForWrite()
Returns a Bytes that wraps this ByteStore from the
start to the realCapacity . |
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.
|
void |
nativeWrite(long address,
long position,
long size)
expert level method to copy data from native memory into the BytesStore
|
default long |
readLimit() |
boolean |
readWrite()
Returns
true . |
default long |
realReadRemaining() |
default long |
realWriteRemaining() |
@NotNull MappedBytesStore |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
@NotNull ByteBuffer bytes,
int offset,
int length) |
@NotNull MappedBytesStore |
write(long writeOffset,
@NotNull RandomDataInput bytes,
long readOffset,
long length) |
void |
write0(long offsetInRDO,
@NotNull RandomDataInput bytes,
long offset,
long length) |
@NotNull MappedBytesStore |
writeByte(long offset,
byte i8)
Write an unsigned byte at an offset.
|
@NotNull MappedBytesStore |
writeDouble(long offset,
double d)
Write a double at an offset.
|
@NotNull MappedBytesStore |
writeFloat(long offset,
float f)
Write a float at an offset.
|
@NotNull MappedBytesStore |
writeInt(long offset,
int i32)
Write an int at an offset.
|
default long |
writeLimit() |
@NotNull MappedBytesStore |
writeLong(long offset,
long i64)
Write a long at an offset.
|
@NotNull MappedBytesStore |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
@NotNull MappedBytesStore |
writeOrderedLong(long offset,
long i)
Perform a non stalling write with a store barrier.
|
default long |
writePosition()
The write position must be
readPosition() <= writePosition() && writePosition() <= writeLimit() |
@NotNull MappedBytesStore |
writeShort(long offset,
short i16)
Write a short at an offset.
|
@NotNull MappedBytesStore |
writeVolatileByte(long offset,
byte i8) |
@NotNull MappedBytesStore |
writeVolatileInt(long offset,
int i32) |
@NotNull MappedBytesStore |
writeVolatileLong(long offset,
long i64) |
@NotNull MappedBytesStore |
writeVolatileShort(long offset,
short i16) |
@NotNull MappedBytesStore |
zeroOut(long start,
long end)
Fills the BytesStore with zeros.
|
bytesForRead, inside, inside, lock, readByte, readPosition, safeLimit, start, translate, tryLock, underlyingCapacity
addAndGetInt, addAndGetLong, addressForRead, addressForWrite, addressForWritePosition, byteCheckSum, byteCheckSum, canReadDirect, capacity, copy, copyTo, copyToDirect, elasticByteBuffer, elasticByteBuffer, equals, fastHash, from, from, init, isDirectMemory, isEqual, lazyNativeBytesStoreWithFixedCapacity, move, nativeRead, nativeStore, nativeStoreWithFixedCapacity, peekUnsignedByte, performRelease, read, read8bit, readDouble, readFloat, readIncompleteLong, readInt, readLong, readShort, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileLong, readVolatileShort, realCapacity, setAddress, sharedMemory, testAndSetInt, toString, toTemporaryDirectByteBuffer, underlyingObject, uninit, uninitialized, wrap, write8bit, write8bit
hashCode, performReleaseInBackground, readRemaining, writeRemaining
assertReferencesReleased, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesStore, charAt, cipher, cipher, contentEquals, copyTo, empty, endsWith, equalBytes, forFields, from, from, hash, isClear, isEmpty, length, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, writeMaxInt, writeMaxLong
addAndGetDouble, addAndGetFloat, compareUtf8, copyTo, copyTo, createCharToString, findByte, parseLong, peekVolatileInt, printable, readBoolean, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
refCount, release, releaseLast, releaseLast, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
chars, codePoints
public ReadOnlyMappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner, MappedFile mappedFile, long start, long address, long capacity, long safeCapacity) throws IllegalStateException
IllegalStateException
@NotNull public @NotNull MappedBytesStore zeroOut(long start, long end)
BytesStore
zeroOut
in interface BytesStore<NativeBytesStore<Void>,Void>
zeroOut
in interface RandomDataOutput<NativeBytesStore<Void>>
zeroOut
in class NativeBytesStore<Void>
start
- first byte inclusiveend
- last byte exclusivepublic boolean compareAndSwapInt(long offset, int expected, int value) throws IllegalStateException
compareAndSwapInt
in class NativeBytesStore<Void>
offset
- to perform CASexpected
- valuevalue
- to setIllegalStateException
public boolean compareAndSwapLong(long offset, long expected, long value) throws IllegalStateException
compareAndSwapLong
in class NativeBytesStore<Void>
offset
- to perform CASexpected
- valuevalue
- to setIllegalStateException
@NotNull public @NotNull MappedBytesStore writeByte(long offset, byte i8) throws IllegalStateException
RandomDataOutput
writeByte
in interface RandomDataOutput<NativeBytesStore<Void>>
writeByte
in class NativeBytesStore<Void>
offset
- to write toi8
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeShort(long offset, short i16) throws IllegalStateException
RandomDataOutput
writeShort
in interface RandomDataOutput<NativeBytesStore<Void>>
writeShort
in class NativeBytesStore<Void>
offset
- to write toi16
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeInt(long offset, int i32) throws IllegalStateException
RandomDataOutput
writeInt
in interface RandomDataOutput<NativeBytesStore<Void>>
writeInt
in class NativeBytesStore<Void>
offset
- to write toi32
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeLong(long offset, long i64) throws IllegalStateException
RandomDataOutput
writeLong
in interface RandomDataOutput<NativeBytesStore<Void>>
writeLong
in class NativeBytesStore<Void>
offset
- to write toi64
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeOrderedLong(long offset, long i) throws IllegalStateException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<NativeBytesStore<Void>>
writeOrderedLong
in class NativeBytesStore<Void>
offset
- to write toi
- value to writeIllegalStateException
@NotNull public @NotNull MappedBytesStore writeFloat(long offset, float f) throws IllegalStateException
RandomDataOutput
writeFloat
in interface RandomDataOutput<NativeBytesStore<Void>>
writeFloat
in class NativeBytesStore<Void>
offset
- to write tof
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeDouble(long offset, double d) throws IllegalStateException
RandomDataOutput
writeDouble
in interface RandomDataOutput<NativeBytesStore<Void>>
writeDouble
in class NativeBytesStore<Void>
offset
- to write tod
- the valueIllegalStateException
@NotNull public @NotNull MappedBytesStore writeVolatileByte(long offset, byte i8) throws IllegalStateException
writeVolatileByte
in interface RandomDataOutput<NativeBytesStore<Void>>
writeVolatileByte
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull MappedBytesStore writeVolatileShort(long offset, short i16) throws IllegalStateException
writeVolatileShort
in interface RandomDataOutput<NativeBytesStore<Void>>
writeVolatileShort
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull MappedBytesStore writeVolatileInt(long offset, int i32) throws IllegalStateException
writeVolatileInt
in interface RandomDataOutput<NativeBytesStore<Void>>
writeVolatileInt
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull MappedBytesStore writeVolatileLong(long offset, long i64) throws IllegalStateException
writeVolatileLong
in interface RandomDataOutput<NativeBytesStore<Void>>
writeVolatileLong
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull MappedBytesStore write(long offsetInRDO, byte[] bytes, int offset, int length) throws IllegalStateException
write
in interface RandomDataOutput<NativeBytesStore<Void>>
write
in class NativeBytesStore<Void>
IllegalStateException
public void write(long offsetInRDO, @NotNull @NotNull ByteBuffer bytes, int offset, int length) throws IllegalStateException
write
in interface RandomDataOutput<NativeBytesStore<Void>>
write
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull MappedBytesStore write(long writeOffset, @NotNull @NotNull RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
write
in interface RandomDataOutput<NativeBytesStore<Void>>
write
in class NativeBytesStore<Void>
BufferOverflowException
BufferUnderflowException
IllegalStateException
public void write0(long offsetInRDO, @NotNull @NotNull RandomDataInput bytes, long offset, long length) throws IllegalStateException
write0
in class NativeBytesStore<Void>
IllegalStateException
public void nativeWrite(long address, long position, long size) throws IllegalStateException
RandomDataOutput
nativeWrite
in interface RandomDataOutput<NativeBytesStore<Void>>
nativeWrite
in class NativeBytesStore<Void>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytesIllegalStateException
@Deprecated public long appendUTF(long pos, char[] chars, int offset, int length) throws IllegalStateException
appendUTF
in class NativeBytesStore<Void>
IllegalStateException
public long appendUtf8(long pos, char[] chars, int offset, int length) throws IllegalStateException
appendUtf8
in class NativeBytesStore<Void>
IllegalStateException
@NotNull public @NotNull VanillaBytes<Void> bytesForWrite() throws IllegalStateException
BytesStore
start
to the realCapacity
.
The returned Bytes is not elastic and can be both read and written using cursors.
bytesForWrite
in interface BytesStore<NativeBytesStore<Void>,Void>
bytesForWrite
in class MappedBytesStore
IllegalStateException
- if this BytesStore has been released@NotNull public @NotNull MappedBytesStore writeOrderedInt(long offset, int i) throws IllegalStateException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<NativeBytesStore<Void>>
writeOrderedInt
in class MappedBytesStore
offset
- to write toi
- value to writeIllegalStateException
public boolean readWrite()
BytesStore
true
.public long writePosition()
readPosition() <= writePosition() && writePosition() <= writeLimit()
public long realReadRemaining()
public long realWriteRemaining()
public long readLimit()
public long writeLimit()
public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
public ByteOrder byteOrder()
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
Copyright © 2021. All rights reserved.