public class BinaryBooleanReference extends AbstractReference implements net.openhft.chronicle.core.values.BooleanValue
The encoding uses 0xB0 for false and 0xB1 for
true to avoid confusion with ASCII digits.
Any other byte value yields undefined behaviour in
getValue().
BytesStore,
BooleanValuebytesStore, offset| Constructor and Description |
|---|
BinaryBooleanReference() |
| Modifier and Type | Method and Description |
|---|---|
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
boolean |
getValue()
Reads a boolean value from the bytes store.
|
long |
maxSize()
Returns the maximum size of the byte representation of a boolean value.
|
void |
setValue(boolean flag)
Writes a boolean value to the bytes store.
|
acceptNewBytesStore, address, bytesStore, lock, offset, performClose, tryLock, unmonitorassertCloseable, assertCloseablesClosed, close, createdHere, disableCloseableTracing, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, toString, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, closeQuietly, closeQuietlypublic void bytesStore(@NotNull
@NotNull BytesStore bytes,
long offset,
long length)
throws IllegalStateException,
IllegalArgumentException,
BufferOverflowException
bytesStore in interface ByteablebytesStore in class AbstractReferencebytes - the BytesStore to setoffset - the offset to setlength - the length to setIllegalArgumentException - If the arguments are invalidBufferOverflowException - If the provided buffer is too smallnet.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 maxSize()
public boolean getValue()
throws IllegalStateException,
BufferUnderflowException
getValue in interface net.openhft.chronicle.core.values.BooleanValueBufferUnderflowException - If the bytes store contains insufficient datanet.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
0xB0 nor 0xB1.IllegalStateExceptionpublic void setValue(boolean flag)
throws IllegalStateException
setValue in interface net.openhft.chronicle.core.values.BooleanValueflag - The boolean value to writenet.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 wayIllegalStateExceptionCopyright © 2026 Chronicle Software Ltd. All rights reserved.