public interface Byteable
Modifier and Type | Method and Description |
---|---|
default long |
address()
Returns the absolute address in the memory to which this object currently points.
|
@Nullable BytesStore<?,?> |
bytesStore()
Returns the ByteStore to which this object currently points.
|
void |
bytesStore(@NotNull BytesStore bytesStore,
long offset,
long length)
Sets the reference to a data type that points to the underlying ByteStore.
|
default FileLock |
lock(boolean shared)
Locks the underlying file.
|
long |
maxSize()
Returns the maximum size in bytes that this reference can point to.
|
long |
offset()
Returns the offset within the ByteStore to which this object currently points.
|
default FileLock |
tryLock(boolean shared)
Attempts to lock the underlying file without blocking.
|
void bytesStore(@NotNull @NotNull BytesStore bytesStore, long offset, long length) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, IllegalArgumentException, BufferOverflowException, BufferUnderflowException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytesStore
- the fixed-point ByteStoreoffset
- the offset within the ByteStore, indicating the starting point of the memory sectionlength
- the length of the memory section within the ByteStoreIllegalArgumentException
- If the provided arguments are invalidBufferOverflowException
- If the new memory section extends beyond the end of the ByteStoreBufferUnderflowException
- If the new memory section starts before the start of the ByteStorenet.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@Nullable @Nullable BytesStore<?,?> bytesStore()
long offset()
default long address() throws UnsupportedOperationException
UnsupportedOperationException
- If the address is not set or the underlying ByteStore isn't nativelong maxSize()
default FileLock lock(boolean shared) throws IOException
shared
- true if the lock is shared, false if it's exclusiveIOException
- If an error occurs while locking the fileUnsupportedOperationException
- If the underlying implementation does not support file lockingdefault FileLock tryLock(boolean shared) throws IOException
shared
- true if the lock is shared, false if it's exclusiveIOException
- If an error occurs while trying to lock the fileUnsupportedOperationException
- If the underlying implementation does not support file lockingCopyright © 2024. All rights reserved.