S - the concrete typepublic interface StreamingDataInput<S extends StreamingDataInput<S>> extends StreamingCommon<S>
RandomCommon.readPosition() by
the number of bytes consumed. Implementations may also offer lenient mode in
which reads beyond a limit return default values rather than throwing.
This interface extends StreamingCommon and ByteStringParser.| Modifier and Type | Method and Description |
|---|---|
long |
copyTo(@NotNull BytesStore<?,?> to)
Copies the data from the input stream to the provided BytesStore.
|
void |
copyTo(@NotNull OutputStream out)
Copies the data from the input stream to the provided OutputStream.
|
default @NotNull InputStream |
inputStream()
Provides an InputStream for the data represented by this StreamingDataInput.
|
boolean |
lenient() |
void |
lenient(boolean lenient)
When there is no more data to read, return zero,
false and empty string. |
default long |
parseHexLong()
Parses a hexadecimal long value from the input stream.
|
default void |
parseUtf8(@NotNull Appendable sb,
boolean utf,
int length)
Parses a UTF-8 string from the input stream into the provided Appendable.
|
default void |
parseUtf8(@NotNull Appendable sb,
int encodedLength)
Parses a UTF-8 string from the input stream into the provided Appendable.
|
int |
peekUnsignedByte()
Peeks (reads without moving the read pointer) the next unsigned byte from the input stream.
|
default byte |
rawReadByte()
Reads a raw byte value from the input stream.
|
default int |
rawReadInt()
Reads a 32-bit integer value from the input stream without performing boundary checks.
|
default long |
rawReadLong()
Reads a 64-bit long value from the input stream without performing boundary checks.
|
default int |
read(byte[] bytes)
Reads the input stream into the provided byte array.
|
default int |
read(byte[] bytes,
int off,
int len)
Reads the input stream into the provided byte array, starting from the given offset and reading up to the specified length.
|
default void |
read(@NotNull ByteBuffer buffer)
Reads the input stream into the provided ByteBuffer.
|
default void |
read(@NotNull Bytes<?> bytes)
Transfers as many bytes as possible from the input stream into the provided Bytes object.
|
default void |
read(@NotNull Bytes<?> bytes,
int length)
Transfers the specified number of bytes from the input stream into the provided Bytes object.
|
default int |
read(char[] bytes,
int off,
int len)
Reads the input stream into the provided char array, starting from the given offset and reading up to the specified length.
|
default @Nullable String |
read8bit()
Reads an 8-bit encoded string from the input stream.
|
default boolean |
read8bit(@NotNull Bytes<?> b)
Reads an 8-bit encoded string from the input stream and appends it to the provided Bytes.
|
default boolean |
read8bit(@NotNull StringBuilder sb)
Reads an 8-bit encoded string from the input stream and appends it to the provided StringBuilder.
|
default @NotNull BigDecimal |
readBigDecimal()
Creates and returns a new BigDecimal representing the contents of this Bytes object.
|
default @NotNull BigInteger |
readBigInteger()
Creates and returns a new BigInteger representing the contents of this Bytes object or
BigInteger.ZERO
if this Bytes object is empty. |
default boolean |
readBoolean()
Reads a boolean value from the input stream.
|
byte |
readByte()
Reads a byte value from the input stream.
|
default char |
readChar()
Reads a character value from the input stream.
|
double |
readDouble()
Reads a 64-bit floating-point number from the input stream.
|
default <E extends Enum<E>> |
readEnum(@NotNull Class<E> eClass)
Reads an Enum value from the input stream.
|
float |
readFloat()
Reads a 32-bit floating-point number from the input stream.
|
default void |
readHistogram(@NotNull net.openhft.chronicle.core.util.Histogram histogram)
Reads data from the input stream into the provided Histogram.
|
default long |
readIncompleteLong() |
int |
readInt()
Reads a 32-bit integer value from the input stream.
|
default int |
readInt24()
Reads a 24-bit signed integer value from the input stream.
|
S |
readLimit(long limit)
Sets the read limit of this StreamingDataInput.
|
default S |
readLimitToCapacity()
Sets the read limit of this StreamingDataInput to its capacity.
|
long |
readLong()
Reads a 64-bit long value from the input stream.
|
S |
readPosition(long position)
Sets the read position of this StreamingDataInput.
|
default long |
readPositionForHeader(boolean skipPadding)
Obtains the current read position, optionally skipping padding bytes if specified.
|
default S |
readPositionRemaining(long position,
long remaining)
Sets the read position and limit of this StreamingDataInput based on the specified position and remaining values.
|
default S |
readPositionUnlimited(long position)
Sets the read position after first widening the read limit to
RandomCommon.capacity(). |
short |
readShort()
Reads a 16-bit short value from the input stream.
|
S |
readSkip(long bytesToSkip)
Advances the read position by
bytesToSkip. |
default long |
readStopBit()
Reads a variable-length integer encoded using the stop bit encoding.
|
default char |
readStopBitChar()
Reads a variable-length character encoded using the stop bit encoding.
|
default double |
readStopBitDecimal()
Reads a decimal number represented as a variable-length double and scale encoded using the stop bit encoding.
|
default double |
readStopBitDouble()
Reads a variable-length double encoded using the stop bit encoding.
|
int |
readUnsignedByte()
Reads the next unsigned 8-bit value from the input stream.
|
default long |
readUnsignedInt()
Reads a 32-bit value from the input stream and converts it to an unsigned integer by masking the sign bit.
|
default int |
readUnsignedInt24()
Reads a 24-bit unsigned integer value from the input stream.
|
default int |
readUnsignedShort()
Reads a 16-bit value from the input stream and converts it to an unsigned short by masking the sign bit.
|
default @Nullable String |
readUtf8()
Reads a UTF-8 encoded string from the input stream.
|
default boolean |
readUtf8(@NotNull Bytes<?> sb)
Reads a UTF-8 encoded string from the input stream and appends it to the provided Bytes.
|
default <C extends Appendable & CharSequence> |
readUtf8(C sb)
Reads a UTF-8 encoded string from the input stream and appends it to the provided appendable.
|
default boolean |
readUtf8(@NotNull StringBuilder sb)
Reads a UTF-8 encoded string from the input stream and appends it to the provided StringBuilder.
|
int |
readVolatileInt()
Reads a volatile (concurrently mutable) integer value from the input stream.
|
long |
readVolatileLong()
Reads a volatile (concurrently mutable) long value from the input stream.
|
default void |
readWithLength(@NotNull Bytes<?> bytes)
Reads data from the input stream with specified length into the provided Bytes.
|
default void |
readWithLength(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumer<S,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer)
Same as
readWithLength0(long, ThrowingConsumerNonCapturing, StringBuilder, BytesOut)
but without the extra StringBuilder and BytesOut
parameters. |
default void |
readWithLength0(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<S,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer,
StringBuilder sb,
BytesOut<?> toBytes)
Temporarily restricts the
RandomCommon.readLimit() to readPosition() + length,
invokes bytesConsumer, then restores the original limit and
advances the read position by length. |
void |
uncheckedReadSkipBackOne()
Unchecked version of readSkip(-1).
|
void |
uncheckedReadSkipOne()
Unchecked version of readSkip(1).
|
int |
uncheckedReadUnsignedByte()
Reads the next unsigned 8-bit value from the input stream without performing boundary checks.
|
default S |
unsafeRead(long address,
int length)
Reads data from the input stream into the memory at the provided address.
|
default void |
unsafeReadObject(@NotNull Object o,
int offset,
int length)
Reads data from the input stream into the provided object, starting from the given offset.
|
clearaddressForRead, addressForRead, addressForWrite, addressForWritePosition, byteOrder, bytesForRead, bytesForWrite, capacity, isDirectMemory, lengthWritten, readLimit, readPosition, readRemaining, realCapacity, realReadRemaining, realWriteRemaining, sharedMemory, start, writeLimit, writePosition, writeRemaining@NotNull S readPosition(long position) throws BufferUnderflowException, IllegalStateException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
position - the new read position, must be non-negativeBufferUnderflowException - If the new position is greater than the limitnet.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 wayIllegalStateException@NotNull default S readPositionUnlimited(long position) throws BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomCommon.capacity(). Useful when random access is required regardless of
the current limit.position - the new read positionBufferUnderflowException - if the position is beyond the capacitynet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed by multiple threads in an unsafe way@NotNull default S readPositionRemaining(long position, long remaining) throws BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
position - the new read position, must be non-negativeremaining - the remaining size, which is used to set the read limitBufferUnderflowException - If the new position is greater than the read limitnet.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 S readLimit(long limit) throws BufferUnderflowException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
limit - the new read limit, must be non-negativeBufferUnderflowException - If the new limit is less than the read positionnet.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 waydefault S readLimitToCapacity() throws BufferUnderflowException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If the capacity is less than the read positionnet.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 S readSkip(long bytesToSkip) throws BufferUnderflowException, IllegalStateException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytesToSkip. If
lenient mode is active, attempts to move beyond
the read limit are capped at the limit without throwing.bytesToSkip - the number of bytes to skipBufferUnderflowException - if the new position exceeds the limit and lenient mode is offnet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed by multiple threads in an unsafe wayIllegalStateExceptiondefault long readPositionForHeader(boolean skipPadding)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
skipPadding - if true, aligns the read position to a 4-byte boundary by skipping padding bytesnet.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 wayvoid uncheckedReadSkipOne()
void uncheckedReadSkipBackOne()
default void readWithLength0(long length,
@NotNull
@NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<S,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer,
StringBuilder sb,
BytesOut<?> toBytes)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
RandomCommon.readLimit() to readPosition() + length,
invokes bytesConsumer, then restores the original limit and
advances the read position by length. Intended for processing
length prefixed sections.length - the temporary lengthbytesConsumer - action to perform within the boundssb - optional string builder used by some consumerstoBytes - optional buffer used by some consumersBufferUnderflowException - if the length exceeds the remaining bytesnet.openhft.chronicle.core.io.IORuntimeException - if the consumer throws an I/O errornet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed by multiple threads in an unsafe waydefault void readWithLength(long length,
@NotNull
@NotNull net.openhft.chronicle.core.util.ThrowingConsumer<S,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
readWithLength0(long, ThrowingConsumerNonCapturing, StringBuilder, BytesOut)
but without the extra StringBuilder and BytesOut
parameters.length - the temporary lengthbytesConsumer - action to perform within the boundsBufferUnderflowException - if the length exceeds the remaining bytesnet.openhft.chronicle.core.io.IORuntimeException - if the consumer throws an I/O errornet.openhft.chronicle.core.io.ClosedIllegalStateException - if the resource has been released or closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed by multiple threads in an unsafe way@NotNull default @NotNull InputStream inputStream()
default long readStopBit()
throws net.openhft.chronicle.core.io.IORuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
BufferUnderflowException
BytesInternal.readStopBit(this).net.openhft.chronicle.core.io.IORuntimeException - If an I/O error occursBufferUnderflowException - If there's not enough data to readnet.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 waydefault char readStopBitChar()
throws net.openhft.chronicle.core.io.IORuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
BufferUnderflowException
BytesInternal.readStopBitChar(this).net.openhft.chronicle.core.io.IORuntimeException - If an I/O error occursBufferUnderflowException - If there's not enough data to readnet.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 waydefault double readStopBitDouble()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException
BytesInternal.readStopBitDouble(this).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 waydefault double readStopBitDecimal()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
BufferUnderflowException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault boolean readBoolean()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BytesUtil.byteToBoolean(b).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 waybyte readByte()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
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 waydefault byte rawReadByte()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
readByte() is that the latter might perform additional processing or checks.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 waydefault char readChar()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
BufferUnderflowException
net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.BufferUnderflowException - If there's not enough data to readint readUnsignedByte()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
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 wayint uncheckedReadUnsignedByte()
short readShort()
throws BufferUnderflowException,
IllegalStateException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 wayIllegalStateExceptiondefault int readUnsignedShort()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault int readInt24()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault int readUnsignedInt24()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 wayint readInt()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault int rawReadInt()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault long readUnsignedInt()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waylong readLong()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydefault long rawReadLong()
throws BufferUnderflowException,
IllegalStateException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 wayIllegalStateExceptiondefault long readIncompleteLong()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
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 wayfloat readFloat()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waydouble readDouble()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 default @Nullable String readUtf8() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, net.openhft.chronicle.core.io.ClosedIllegalStateException, ArithmeticException
null values and
utilizes stop bit encoding for length, saving one byte for strings shorter than 128 characters.null if writeUtf8(null) was calledBufferUnderflowException - If there's not enough data to readnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursnet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.ArithmeticException - If numeric overflow or underflow occurs@Nullable default @Nullable String read8bit() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, ArithmeticException
null if write8bit(null) was calledBufferUnderflowException - If there's not enough data to readnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursnet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.ArithmeticException - If numeric overflow or underflow occursdefault <C extends Appendable & CharSequence> boolean readUtf8(@NotNull C sb) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, ArithmeticException, net.openhft.chronicle.core.io.ClosedIllegalStateException, IllegalArgumentException
readUtf8(), except it populates a provided appendable instead of creating a new string.sb - the appendable to which the read string will be appendedtrue if there was a String, or false if it was nullnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursBufferUnderflowException - If there's not enough data to readArithmeticException - If numeric overflow or underflow occursnet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.IllegalArgumentException - If the appendable does not allow setting lengthdefault boolean readUtf8(@NotNull
@NotNull Bytes<?> sb)
throws net.openhft.chronicle.core.io.IORuntimeException,
BufferUnderflowException,
ArithmeticException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
readUtf8(), except it populates a provided Bytes instance instead of creating a new string.sb - the Bytes instance to which the read string will be appendedtrue if there was a String, or false if it was nullnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursBufferUnderflowException - If there's not enough data to readArithmeticException - If numeric overflow or underflow occursnet.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 waydefault boolean readUtf8(@NotNull
@NotNull StringBuilder sb)
throws net.openhft.chronicle.core.io.IORuntimeException,
BufferUnderflowException,
ArithmeticException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
readUtf8(), except it populates a provided StringBuilder instead of creating a new string.sb - the StringBuilder to which the read string will be appendedtrue if there was a String, or false if it was nullnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursBufferUnderflowException - If there's not enough data to readArithmeticException - If numeric overflow or underflow occursnet.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 waydefault boolean read8bit(@NotNull
@NotNull Bytes<?> b)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
ArithmeticException,
BufferOverflowException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
b - the Bytes instance to which the read string will be appendedtrue if there was a String, or false if it was nullBufferUnderflowException - If there's not enough data to readArithmeticException - If numeric overflow or underflow occursBufferOverflowException - If the buffer is fullnet.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 waydefault boolean read8bit(@NotNull
@NotNull StringBuilder sb)
throws net.openhft.chronicle.core.io.IORuntimeException,
BufferUnderflowException,
ArithmeticException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
sb - the StringBuilder to which the read string will be appendedtrue if there was a String, or false if it was nullnet.openhft.chronicle.core.io.IORuntimeException - If an IO error occursBufferUnderflowException - If there's not enough data to readArithmeticException - If numeric overflow or underflow occursnet.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 waydefault int read(byte[] bytes)
throws BufferUnderflowException,
IllegalStateException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the byte array to fill with the read dataBufferUnderflowException - If there's not enough data to readnet.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 wayIllegalStateExceptiondefault int read(byte[] bytes,
int off,
int len)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the byte array to fill with the read dataoff - the start offset in the byte arraylen - the maximum number of bytes to readBufferUnderflowException - If there's not enough data to readnet.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 waydefault int read(char[] bytes,
int off,
int len)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the char array to fill with the read dataoff - the start offset in the char arraylen - the maximum number of chars to readnet.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 waydefault void read(@NotNull
@NotNull ByteBuffer buffer)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
buffer - the ByteBuffer to fill with the read 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 waydefault void read(@NotNull
@NotNull Bytes<?> bytes)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the Bytes object to fill with the read 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 wayStreamingDataOutput.write(BytesStore)default void read(@NotNull
@NotNull Bytes<?> bytes,
int length)
throws BufferUnderflowException,
BufferOverflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the Bytes object to fill with the read datalength - the number of bytes to readBufferUnderflowException - If there's not enough data to readBufferOverflowException - If there's not enough space in the provided Bytes objectnet.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 waydefault void unsafeReadObject(@NotNull
@NotNull Object o,
int offset,
int length)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
o - the object to fill with the read dataoffset - the start offset in the objectlength - the number of bytes to readBufferUnderflowException - If there's not enough data to readnet.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 waydefault S unsafeRead(long address, int length) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
address - the address of the memory to fill with the read datalength - the number of bytes to readnet.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 wayint readVolatileInt()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 waylong readVolatileLong()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 wayint peekUnsignedByte()
throws net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
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 default <E extends Enum<E>> E readEnum(@NotNull @NotNull Class<E> eClass) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, ArithmeticException, net.openhft.chronicle.core.io.ClosedIllegalStateException, BufferOverflowException
eClass - the class of the Enumnet.openhft.chronicle.core.io.IORuntimeException - If an I/O error occursBufferUnderflowException - If there's not enough data to readArithmeticException - If the number format is invalidnet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.BufferOverflowException - If there's not enough space in the bufferdefault void parseUtf8(@NotNull
@NotNull Appendable sb,
int encodedLength)
throws IllegalArgumentException,
BufferUnderflowException,
UTFDataFormatRuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
sb - the Appendable to fill with the parsed stringencodedLength - the length of the UTF-8 encoded data in bytesIllegalArgumentException - If an illegal argument is providedBufferUnderflowException - If there's not enough data to readUTFDataFormatRuntimeException - If the string is not valid UTF-8net.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 waydefault void parseUtf8(@NotNull
@NotNull Appendable sb,
boolean utf,
int length)
throws IllegalArgumentException,
BufferUnderflowException,
UTFDataFormatRuntimeException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
sb - the Appendable to fill with the parsed stringutf - true if the length is the UTF-8 encoded length, false if the length is the length of charslength - the maximum number of bytes to readIllegalArgumentException - If an illegal argument is providedBufferUnderflowException - If there's not enough data to readUTFDataFormatRuntimeException - If the string is not valid UTF-8net.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 waydefault long parseHexLong()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
BufferUnderflowException - If there's not enough data to readnet.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 wayvoid copyTo(@NotNull
@NotNull OutputStream out)
throws IOException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
out - the OutputStream to copy the data toIOException - If an I/O error occursnet.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 waylong copyTo(@NotNull
@NotNull BytesStore<?,?> to)
throws net.openhft.chronicle.core.io.ClosedIllegalStateException
to - the BytesStore to copy the data tonet.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 waydefault void readHistogram(@NotNull
@NotNull net.openhft.chronicle.core.util.Histogram histogram)
throws BufferUnderflowException,
IllegalStateException,
ArithmeticException,
net.openhft.chronicle.core.io.ClosedIllegalStateException
histogram - the Histogram to fill with dataBufferUnderflowException - If there's not enough data to readnet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.ArithmeticException - If the number format is invalidIllegalStateExceptiondefault void readWithLength(@NotNull
@NotNull Bytes<?> bytes)
throws ArithmeticException,
BufferUnderflowException,
BufferOverflowException,
net.openhft.chronicle.core.io.ClosedIllegalStateException,
net.openhft.chronicle.core.io.ThreadingIllegalStateException
bytes - the Bytes to fill with dataArithmeticException - If the number format is invalidBufferUnderflowException - If there's not enough data to readBufferOverflowException - If there's not enough space in the buffernet.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 wayvoid lenient(boolean lenient)
false and empty string.lenient - if true, return nothing rather than error.boolean lenient()
@NotNull default @NotNull BigDecimal readBigDecimal() throws ArithmeticException, BufferUnderflowException, IllegalStateException, net.openhft.chronicle.core.io.ClosedIllegalStateException
If this Byte object is empty, an object equal to BigDecimal.ZERO is returned.
ArithmeticException - If the content of this Bytes object could not be successfully convertedBufferUnderflowException - If the content of this Bytes object is insufficient to be successfully convertednet.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 wayIllegalStateException@NotNull default @NotNull BigInteger readBigInteger() throws ArithmeticException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException
BigInteger.ZERO
if this Bytes object is empty.ArithmeticException - If the content of this Bytes object could not be successfully convertedBufferUnderflowException - If the content of this Bytes object is insufficient to be successfully convertednet.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 wayCopyright © 2026 Chronicle Software Ltd. All rights reserved.