public class MappedBytesStore extends net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>
NativeBytesStore backed by a region of a memory-mapped file.
Direct access methods assume the caller performs bounds checking; misuse can corrupt memory.
| Modifier and Type | Field and Description |
|---|---|
protected Runnable |
writeCheck
run before each write, throws if read only
|
address, limit, maximumLimit, memory| Modifier | Constructor and Description |
|---|---|
protected |
MappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
MappedFile mappedFile,
long start,
long address,
long capacity,
long safeCapacity,
int pageSize)
Constructs a
MappedBytesStore for a mapped region. |
| Modifier and Type | Method and Description |
|---|---|
long |
appendUtf8(long pos,
char[] chars,
int offset,
int length) |
@NotNull Bytes<Void> |
bytesForRead()
Returns a Bytes that wraps this ByteStore from the
start to the realCapacity. |
@NotNull VanillaBytes<Void> |
bytesForWrite()
Returns a Bytes that wraps this ByteStore from the
start to the realCapacity. |
boolean |
compareAndSwapInt(long offset,
int expected,
int value)
Performs a 32-bit compare-and-swap (CAS) operation at a given offset.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Performs a 64-bit compare-and-swap (CAS) operation at a given offset.
|
static MappedBytesStore |
create(net.openhft.chronicle.core.io.ReferenceOwner owner,
MappedFile mappedFile,
long start,
long address,
long capacity,
long safeCapacity,
int pageSize)
Factory method mirroring the protected constructor.
|
boolean |
inside(long offset)
Returns
true if the given offset lies within this mapping's safe range. |
boolean |
inside(long offset,
long bufferSize)
Same as
inside(long) but also checks the end of the supplied range. |
FileLock |
lock(long position,
long size,
boolean shared)
Acquires a lock on a region of the underlying file.
|
void |
nativeWrite(long address,
long position,
long size)
Expert-level method that copies data directly from native memory into this BytesStore.
|
protected void |
performRelease()
Syncs the mapped region to disk prior to release if required.
|
byte |
readByte(long offset)
Reads a byte value from a specific offset.
|
long |
readPosition()
/**
|
long |
safeLimit() |
long |
start() |
SyncMode |
syncMode() |
void |
syncMode(SyncMode syncMode)
Set the sync mode for this ByteStore
|
void |
syncUpTo(long position)
Synchronise from the last complete page up to this position.
|
void |
syncUpTo(long position,
SyncMode syncMode)
Synchronise from the last complete page up to this position.
|
long |
translate(long offset)
Converts a logical offset in the file into an offset relative to this mapped region.
|
FileLock |
tryLock(long position,
long size,
boolean shared)
Attempts to acquire a lock on a region of the underlying file.
|
long |
underlyingCapacity() |
@NotNull MappedBytesStore |
write(long offsetInRDO,
byte[] byteArray,
int offset,
int length)
Copies the provided
byteArray to this Bytes object starting at writeOffset taking
content starting at readOffset but copying at most length bytes. |
void |
write(long offsetInRDO,
@NotNull ByteBuffer bytes,
int offset,
int length)
Copies a segment from the provided ByteBuffer into this data output.
|
@NotNull MappedBytesStore |
write(long writeOffset,
@NotNull RandomDataInput bytes,
long readOffset,
long length)
Copies a segment from the provided RandomDataInput into this data output.
|
void |
write0(long offsetInRDO,
@NotNull RandomDataInput bytes,
long offset,
long length) |
@NotNull MappedBytesStore |
writeByte(long offset,
byte i8)
Writes a byte at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeDouble(long offset,
double d)
Writes a double-precision floating-point value at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeFloat(long offset,
float f)
Writes a single-precision floating-point value at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeInt(long offset,
int i32)
Writes an integer value at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeLong(long offset,
long i64)
Writes a long integer value at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeOrderedInt(long offset,
int i)
Performs a non-blocking write operation with a memory barrier to ensure order of stores.
|
@NotNull MappedBytesStore |
writeOrderedLong(long offset,
long i)
Performs a non-blocking write operation with a memory barrier to ensure order of stores.
|
@NotNull MappedBytesStore |
writeShort(long offset,
short i16)
Writes a short integer at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeVolatileByte(long offset,
byte i8)
Writes a volatile byte at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeVolatileInt(long offset,
int i32)
Writes a volatile integer at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeVolatileLong(long offset,
long i64)
Writes a volatile long integer at the specified non-negative offset.
|
@NotNull MappedBytesStore |
writeVolatileShort(long offset,
short i16)
Writes a volatile short at the specified non-negative offset.
|
@NotNull MappedBytesStore |
zeroOut(long start,
long end)
Fills the BytesStore with zeros.
|
addressForRead, addressForWrite, addressForWritePosition, appendAndReturnLength, backgroundPerformRelease, byteCheckSum, byteCheckSum, canReadDirect, capacity, copy, copyTo, copyToDirect, elasticByteBuffer, elasticByteBuffer, equals, fastHash, follow, from, from, hashCode, isDirectMemory, isEqual, lazyNativeBytesStoreWithFixedCapacity, move, nativeRead, nativeStore, nativeStoreWithFixedCapacity, peekUnsignedByte, read, read8bit, readDouble, readFloat, readIncompleteLong, readInt, readLong, readShort, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileLong, readVolatileShort, realCapacity, reverseBytesFrom, setAddress, sharedMemory, testAndSetInt, toString, toTemporaryDirectByteBuffer, underlyingObject, uninitialized, wrap, write8bit, write8bitcanReleaseInBackground, readRemaining, writeRemainingaddReferenceChangeListener, assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceCountedUnmonitored, referenceId, release, releaseLast, removeReferenceChangeListener, reserve, reserveTransfer, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, unmonitor, warnAndReleaseIfNotReleasedclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAndGetDouble, addAndGetDoubleNotAtomic, addAndGetFloat, addAndGetFloatNotAtomic, addAndGetInt, addAndGetIntNotAtomic, addAndGetLong, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesStore, charAt, cipher, cipher, compareAndSwapDouble, compareAndSwapFloat, contentEquals, copyTo, empty, endsWith, equalBytes, forFields, from, from, hash, isClear, isEmpty, length, nativePointer, nativeStoreFrom, readWrite, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, toUtf8String, wrap, wrap, writeMaxInt, writeMaxLongcanReadDirect, compareUtf8, copyTo, copyTo, findByte, parseLong, peekVolatileInt, printable, readBoolean, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArrayappend, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloataddressForRead, byteOrder, lengthWritten, readLimit, realReadRemaining, realWriteRemaining, writeLimit, writePositionaddReferenceChangeListener, refCount, release, releaseLast, releaseLast, removeReferenceChangeListener, reserve, reserveTransfer, tryReservereferenceId, referenceName, temporarychars, codePointsprotected final Runnable writeCheck
protected MappedBytesStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
MappedFile mappedFile,
long start,
long address,
long capacity,
long safeCapacity,
int pageSize)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException
MappedBytesStore for a mapped region.owner - reference ownermappedFile - parent mapped filestart - logical start offsetaddress - native address of the mappingcapacity - mapped capacitysafeCapacity - portion guaranteed not to cross a chunkpageSize - page size for alignmentnet.openhft.chronicle.core.io.ClosedIllegalStateExceptionpublic static MappedBytesStore create(net.openhft.chronicle.core.io.ReferenceOwner owner, MappedFile mappedFile, long start, long address, long capacity, long safeCapacity, int pageSize) throws net.openhft.chronicle.core.io.ClosedIllegalStateException
net.openhft.chronicle.core.io.ClosedIllegalStateExceptionpublic long underlyingCapacity()
NativeBytesStore.capacity() if alignment is applied@NotNull public @NotNull Bytes<Void> bytesForRead() throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
BytesStorestart to the realCapacity.
The returned Bytes is not elastic and can be both read and written using cursors.
net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way.@NotNull public @NotNull VanillaBytes<Void> bytesForWrite() throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
BytesStorestart to the realCapacity.
The returned Bytes is not elastic and can be both read and written using cursors.
bytesForWrite in interface BytesStore<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>,Void>bytesForWrite in interface RandomCommonbytesForWrite in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way.public boolean inside(long offset)
true if the given offset lies within this mapping's safe range.offset - byte index to checktrue if the offset is within RandomCommon.start() and BytesStore.safeLimit()public boolean inside(long offset,
long bufferSize)
inside(long) but also checks the end of the supplied range.public long safeLimit()
safeLimit in interface BytesStore<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>,Void>safeLimit in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>public byte readByte(long offset)
RandomDataInputreadByte in interface RandomDataInputreadByte in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - the location from where the byte value is read.@NotNull public @NotNull MappedBytesStore writeOrderedInt(long offset, int i) throws IllegalStateException
RandomDataOutputwriteOrderedInt in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeOrderedInt in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the integer to.i - The integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionpublic long translate(long offset)
translate in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - logical offset within the storeoffsetpublic long start()
start in interface RandomCommonstart in class net.openhft.chronicle.bytes.internal.AbstractBytesStore<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>,Void>public long readPosition()
RandomCommonreadPosition in interface RandomCommonreadPosition in class net.openhft.chronicle.bytes.internal.AbstractBytesStore<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>,Void>start() <= readPosition() <= writePosition() and readPosition() <= readLimit().public FileLock lock(long position, long size, boolean shared) throws IOException
position - The starting byte position of the region to lock.size - The number of bytes to lock, starting from the position.shared - If true, the lock will be shared; otherwise, it will be exclusive.IOException - If an I/O error occurs while locking.for details on how the lock is acquired.public FileLock tryLock(long position, long size, boolean shared) throws IOException
position - The starting byte position of the region to lock.size - The number of bytes to lock, starting from the position.shared - If true, the lock will be shared; otherwise, it will be exclusive.null if the lock could not be acquired.IOException - If an I/O error occurs while trying to lock.for details on how the lock is attempted.@NotNull public @NotNull MappedBytesStore zeroOut(long start, long end)
BytesStorezeroOut in interface BytesStore<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>,Void>zeroOut in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>zeroOut in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>start - first byte inclusiveend - last byte exclusivepublic boolean compareAndSwapInt(long offset,
int expected,
int value)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputcompareAndSwapInt in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>compareAndSwapInt in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - the offset at which to perform the CAS operation.expected - the expected current value.value - the new value to set if the current value matches the expected value.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe waypublic boolean compareAndSwapLong(long offset,
long expected,
long value)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputcompareAndSwapLong in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>compareAndSwapLong in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - the offset at which to perform the CAS operation.expected - the expected current value.value - the new value to set if the current value matches the expected value.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeByte(long offset, byte i8) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteByte in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeByte in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the byte to.i8 - The byte value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeShort(long offset, short i16) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteShort in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeShort in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the short integer to.i16 - The short integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeInt(long offset, int i32) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteInt in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeInt in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the integer to.i32 - The integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeLong(long offset, long i64) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteLong in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeLong in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the long integer to.i64 - The long integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeOrderedLong(long offset, long i) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteOrderedLong in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeOrderedLong in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the long integer to.i - The long integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeFloat(long offset, float f) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteFloat in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeFloat in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the float to.f - The float value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeDouble(long offset, double d) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteDouble in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeDouble in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the double to.d - The double value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeVolatileByte(long offset, byte i8) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteVolatileByte in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeVolatileByte in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the byte to.i8 - The byte value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeVolatileShort(long offset, short i16) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteVolatileShort in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeVolatileShort in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the short to.i16 - The short value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeVolatileInt(long offset, int i32) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteVolatileInt in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeVolatileInt in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the integer to.i32 - The integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore writeVolatileLong(long offset, long i64) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputwriteVolatileLong in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>writeVolatileLong in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offset - The non-negative position within the data stream to write the long integer to.i64 - The long integer value to write.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore write(long offsetInRDO, byte[] byteArray, int offset, int length) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputbyteArray to this Bytes object starting at writeOffset taking
content starting at readOffset but copying at most length bytes.
Does not update cursors e.g. RandomCommon.writePosition()
write in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>write in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offsetInRDO - the non-negative offset within the data output where the segment should be written.byteArray - the byte array containing the segment to be written.offset - the non-negative offset within the byte array where the segment begins.length - the non-negative length of the segment.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe waypublic void write(long offsetInRDO,
@NotNull
@NotNull ByteBuffer bytes,
int offset,
int length)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutput
Does not update cursors e.g. RandomCommon.writePosition()
write in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>write in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>offsetInRDO - the non-negative offset within the data output where the segment should be written.bytes - the ByteBuffer containing the segment to be written.offset - the non-negative offset within the ByteBuffer where the segment begins.length - the non-negative length of the segment.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe way@NotNull public @NotNull MappedBytesStore write(long writeOffset, @NotNull @NotNull RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputRandomCommon.writePosition() of this output nor the RandomCommon.readPosition() of the input.write in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>write in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>writeOffset - the non-negative offset within this data output where the segment should be written.bytes - the RandomDataInput source containing the segment to be written.readOffset - the non-negative offset within the source where the segment begins.length - the non-negative length of the segment.BufferOverflowException - If the capacity of this data output was exceeded.BufferUnderflowException - If the source does not have enough data to fill the length.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe waypublic void write0(long offsetInRDO,
@NotNull
@NotNull RandomDataInput bytes,
long offset,
long length)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException
write0 in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>net.openhft.chronicle.core.io.ClosedIllegalStateExceptionpublic void nativeWrite(long address,
long position,
long size)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomDataOutputnativeWrite in interface RandomDataOutput<net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>>nativeWrite in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>address - the address in the native memory from where data should be copied.position - the position in the BytesStore where data should be written.size - the size of the data, in bytes, to be copied from the native memory.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe waypublic long appendUtf8(long pos,
char[] chars,
int offset,
int length)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
appendUtf8 in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>net.openhft.chronicle.core.io.ClosedIllegalStateExceptionnet.openhft.chronicle.core.io.ThreadingIllegalStateExceptionprotected void performRelease()
performRelease in class net.openhft.chronicle.bytes.internal.NativeBytesStore<Void>public SyncMode syncMode()
public void syncMode(SyncMode syncMode)
syncMode - to usepublic void syncUpTo(long position)
position - to sync with the syncMode()public void syncUpTo(long position,
SyncMode syncMode)
position - to sync with the syncMode()syncMode - to useCopyright © 2026 Chronicle Software Ltd. All rights reserved.