B - concrete type for fluent chainingpublic interface ByteStringAppender<B extends ByteStringAppender<B>> extends StreamingDataOutput<B>, Appendable
StreamingDataOutput and Appendable that exposes
convenience methods for writing text and numbers to a Bytes stream.
Each method returns this to allow fluent call chains.JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16| Modifier and Type | Method and Description |
|---|---|
default B |
append(@NotNull BigDecimal bigDecimal)
Appends a string representation of a specified BigDecimal to this.
|
default B |
append(boolean flag)
Appends a boolean as 'T' or 'F' character.
|
default B |
append(char ch)
Appends the given character, typically encoded as UTF-8.
|
default B |
append(@NotNull CharSequence cs)
Appends the supplied character sequence, encoded as UTF-8.
|
default B |
append(@NotNull CharSequence cs,
int start,
int end)
Appends a portion of a string to the Bytes in UTF-8.
|
default B |
append(double d)
Appends
d using the current Decimaliser strategy. |
default B |
append(double d,
int decimalPlaces)
Appends a double in decimal notation to a specific number of decimal places.
|
default B |
append(float f)
Appends
f using the configured Decimaliser. |
default B |
append(int value)
Appends an int in decimal to this.
|
default B |
append(long value)
Appends a long value in decimal.
|
default B |
append8bit(@NotNull BytesStore<?,?> bs)
Appends the content of
bs assuming one byte per character (ISO-8859-1). |
default B |
append8bit(@NotNull BytesStore<?,?> bs,
long start,
long end)
Appends a portion of a BytesStore to this in ISO-8859-1 format.
|
default B |
append8bit(@NotNull CharSequence cs)
Appends a String to the Bytes in ISO-8859-1.
|
default B |
append8bit(@NotNull CharSequence cs,
int start,
int end)
Appends a portion of a string to this Bytes in ISO-8859-1.
|
default B |
append8bit(@NotNull String cs)
Appends
cs in 8-bit encoding (ISO-8859-1). |
default B |
appendBase(long value,
int base)
Appends a string representation of the first argument in the radix specified by the second argument.
|
default B |
appendBase16(long value)
Appends the base 16 (hexadecimal) representation of the specified long value.
|
default B |
appendBase16(long value,
int minDigits)
Appends the base 16 (hexadecimal) representation of the specified long value,
padding with leading zeroes if the number of digits is less than minDigits.
|
default B |
appendDateMillis(long dateInMillis)
Converts a specified long number to a date in the format yyyymmdd and appends the date to this.
|
default B |
appendDecimal(long value,
int decimalPlaces)
Appends
value as a decimal number with decimalPlaces digits after the decimal point. |
default B |
appendTimeMillis(long timeOfDayInMillis)
Converts a specified long number to time of day and appends it to this.
|
Decimaliser |
decimaliser()
Returns the strategy used to convert floating point values to text.
|
B |
decimaliser(Decimaliser decimaliser)
Sets the
Decimaliser controlling how floating point numbers are rendered. |
boolean |
fpAppend0()
Deprecated.
to be removed in x.28. Use
decimaliser(Decimaliser) to control formatting. |
B |
fpAppend0(boolean append0)
Deprecated.
to be removed in x.28. Use
decimaliser(Decimaliser) instead. |
default @NotNull Writer |
writer()
Returns the current ByteStringAppender instance as a Writer.
|
appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, canWriteDirect, copyFrom, ensureCapacity, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, realCapacity, unsafeWrite, unsafeWriteObject, write, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeByte, writeChar, writeDouble, writeDoubleAndInt, writeEnum, writeFloat, writeHistogram, writeInt, writeInt24, writeIntAdv, writeLimit, writeLong, writeLongAdv, writeOrderedInt, writeOrderedLong, writePosition, writePositionForHeader, writePositionRemaining, writeShort, writeSkip, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeWithLength, writeWithLengthclearaddressForRead, addressForRead, addressForWrite, addressForWritePosition, byteOrder, bytesForRead, bytesForWrite, capacity, isDirectMemory, lengthWritten, readLimit, readPosition, readRemaining, realReadRemaining, realWriteRemaining, sharedMemory, start, writeLimit, writePosition, writeRemaining@NotNull default @NotNull Writer writer()
@NotNull default B append(char ch) throws IllegalStateException
append in interface Appendablech - character to appendBufferOverflowException - if no space is availablenet.openhft.chronicle.core.io.ClosedIllegalStateException - if the appender has been closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed from multiple threads unsafelyIllegalStateException@NotNull default B append(@NotNull @NotNull CharSequence cs)
append in interface Appendablecs - text to appendBufferUnderflowException - if the buffer cannot resizenet.openhft.chronicle.core.io.ClosedIllegalStateException - if closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed concurrently@NotNull default B append(boolean flag) throws BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
flag - to appendBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacitynet.openhft.chronicle.core.io.IORuntimeException - If an error occurred while attempting to resize the underlying 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 way.@NotNull default B append(int value) throws BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
value - the integer value to appendBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacitynet.openhft.chronicle.core.io.IORuntimeException - If an error occurred while attempting to resize the underlying 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 way.@NotNull default B append(long value) throws BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
value - the long number to appendBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacitynet.openhft.chronicle.core.io.IORuntimeException - If an error occurred while attempting to resize the underlying 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 way.@NotNull default B appendBase(long value, int base) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
value - the number to appendbase - the radix that the specified value should be converted to before appendBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacityIllegalArgumentException - If the specified arguments are illegalnet.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 B appendBase16(long value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
value - the long value to be converted to base 16 and appendedBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacityIllegalArgumentException - If the specified argument is illegalnet.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 B appendBase16(long value, int minDigits) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
value - the long value to be converted to base 16 and appendedminDigits - the minimum number of digits to be appendedBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacityIllegalArgumentException - If the specified argument is illegalnet.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.IllegalStateException@NotNull default B appendDecimal(long value, int decimalPlaces) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
value as a decimal number with decimalPlaces digits after the decimal point.
For example appendDecimal(12345, 2) appends "123.45".value - number scaled by 10^decimalPlacesdecimalPlaces - number of decimal digits to outputBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacitynet.openhft.chronicle.core.io.IORuntimeException - If an error occurred while attempting to resize the underlying bufferIllegalArgumentException - If the decimalPlaces is negative or too largenet.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.IllegalStateException@NotNull default B append(float f) throws BufferOverflowException, IllegalStateException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
f using the configured Decimaliser. Very small or
large values may fall back to Float.toString().BufferOverflowExceptionIllegalStateExceptionnet.openhft.chronicle.core.io.ClosedIllegalStateExceptionnet.openhft.chronicle.core.io.ThreadingIllegalStateException@NotNull default B append(double d) throws BufferOverflowException, IllegalStateException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
d using the current Decimaliser strategy.BufferOverflowExceptionIllegalStateExceptionnet.openhft.chronicle.core.io.ClosedIllegalStateExceptionnet.openhft.chronicle.core.io.ThreadingIllegalStateExceptionDecimaliser decimaliser()
B decimaliser(Decimaliser decimaliser)
Decimaliser controlling how floating point numbers are rendered.decimaliser - implementation to use@Deprecated boolean fpAppend0()
decimaliser(Decimaliser) to control formatting..0 is appended to whole floating point values.@Deprecated B fpAppend0(boolean append0)
decimaliser(Decimaliser) instead..0 is appended to whole floating point values.@NotNull default B append(double d, int decimalPlaces) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
If the number would normally be printed with more decimal places, the number is rounded.
d - to appenddecimalPlaces - to always produceBufferOverflowException - If the capacity of the underlying buffer was exceedednet.openhft.chronicle.core.io.IORuntimeException - If an error occurred while attempting to resize the underlying bufferIllegalArgumentException - If the decimalPlaces is negative or too largenet.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 B append(@NotNull @NotNull CharSequence cs, int start, int end) throws IndexOutOfBoundsException
append in interface Appendablecs - the CharacterSequence to appendstart - index of the first char inclusiveend - index of the last char exclusiveBufferOverflowException - If the capacity of the underlying buffer was exceededIndexOutOfBoundsException - If the specified indexes are out of rangenet.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 B append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
cs - the CharSequence to appendBufferOverflowException - If the string is too large to write in the capacity availableBufferUnderflowException - If the capacity of the underlying buffer was exceedednet.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.default B append8bit(@NotNull @NotNull BytesStore<?,?> bs) throws BufferOverflowException, BufferUnderflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
bs assuming one byte per character (ISO-8859-1).
Characters outside the 8-bit range are replaced with '?'.bs - the BytesStore to appendBufferOverflowException - If the BytesStore is too large to write in the capacity availableBufferUnderflowException - If the capacity of the underlying buffer was exceedednet.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.default B append8bit(@NotNull @NotNull String cs) throws BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
cs in 8-bit encoding (ISO-8859-1). Characters above 255 become '?'.cs - the String to appendBufferOverflowException - If the string is too large to write in the capacity availablenet.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.default B append8bit(@NotNull @NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
cs - the CharSequence to appendstart - index of the first char of cs (inclusive) to appendend - index of the last char of cs (exclusive) to appendBufferOverflowException - If the string is too large to write in the capacity availableBufferUnderflowException - If the capacity of the underlying buffer was exceededIndexOutOfBoundsException - If the start or the end are not valid for the CharSequenceIllegalArgumentException - If the start or end is negative or too largenet.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.default B append8bit(@NotNull @NotNull BytesStore<?,?> bs, long start, long end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
bs - the specified BytesStore that a portion of it will be appended to thisstart - the index of first byte (inclusive) of bs to appendend - the number of bytes of bs to appendIllegalArgumentException - If an illegal argument is passed to the methodBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacityBufferUnderflowException - If the capacity of the BytesStore was exceededIndexOutOfBoundsException - If the specified indexes for the BytesStore are out of rangenet.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 B appendDateMillis(long dateInMillis) throws BufferOverflowException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
dateInMillis - the specified long to convert to date and append to thisBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacitynet.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 B appendTimeMillis(long timeOfDayInMillis) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
Twelve bytes in the format of hh:mm:ss.ddd will be appended to this. hh, mm, ss and ddd represent hour, minute, second and millisecond.
timeOfDayInMillis - the long number that represents time of day in millisecondsBufferOverflowException - If the relative append operation exceeds the underlying buffer's capacityIllegalArgumentException - If an illegal argument is passed to the methodnet.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 B append(@NotNull @NotNull BigDecimal bigDecimal) throws net.openhft.chronicle.core.io.ClosedIllegalStateException, net.openhft.chronicle.core.io.ThreadingIllegalStateException
The string representation of the BigDecimal number is a standard canonical string form as
described in BigDecimal.toString().
bigDecimal - the specified BigDecimal to appendnet.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.BigDecimalCopyright © 2026 Chronicle Software Ltd. All rights reserved.