public interface ByteStringAppender<B extends ByteStringAppender<B>> extends StreamingDataOutput<B>, Appendable
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
default long |
addressForRead(long offset,
int buffer) |
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWritePosition() |
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 a char in UTF-8.
|
default B |
append(@NotNull CharSequence cs)
Append a characters in 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 a double in decimal notation
|
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 a float in decimal notation
|
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 a BytesStore to this in 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 a string to this Bytes in ISO-8859-1 format.
|
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) |
default B |
appendBase16(long value,
int 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 a long in decimal with a given number of decimal places.
|
default B |
appendTimeMillis(long timeOfDayInMillis)
Converts a specified long number to time of day and appends it to this.
|
default ByteOrder |
byteOrder() |
@NotNull Bytes<?> |
bytesForRead() |
@NotNull Bytes<?> |
bytesForWrite() |
default long |
capacity() |
boolean |
isDirectMemory() |
default long |
lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
|
default long |
readLimit()
If the resource is closed, the returned value is unspecified.
|
default long |
readPosition()
Returns the read position.
|
default long |
readRemaining()
Returns the remaining bytes that can be read.
|
default long |
realReadRemaining()
If the resource is closed, the returned value is unspecified.
|
default long |
realWriteRemaining()
If the resource is closed, the returned value is unspecified.
|
boolean |
sharedMemory() |
default long |
start() |
default long |
writeLimit()
Returns the write limit.
|
default long |
writePosition()
Returns the write position.
|
default @NotNull Writer |
writer() |
default long |
writeRemaining()
If the resource is closed, the returned value is unspecified.
|
appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, canWriteDirect, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, realCapacity, unsafeWrite, unsafeWriteObject, unsafeWriteObject, write, write, 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, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeWithLength
clear
@NotNull default @NotNull Writer writer()
@NotNull default B append(char ch) throws IllegalStateException
append
in interface Appendable
ch
- the character to appendBufferOverflowException
- if the relative append operation exceeds the underlying buffer's capacityIllegalStateException
- if the underlying Bytes is closed@NotNull default B append(@NotNull @NotNull CharSequence cs)
append
in interface Appendable
cs
- the CharSequence to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceeded@NotNull default B append(boolean flag) throws BufferOverflowException, IllegalStateException
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 bufferIllegalStateException
@NotNull default B append(int value) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
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 bufferIllegalArgumentException
IllegalStateException
@NotNull default B append(long value) throws BufferOverflowException, IllegalStateException
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 bufferIllegalStateException
@NotNull default B appendBase(long value, int base) throws BufferOverflowException, IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException
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 illegalIllegalStateException
- if the underlying buffer was releasedIndexOutOfBoundsException
@NotNull default B appendBase16(long value) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
@NotNull default B appendBase16(long value, int minDigits) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
@NotNull default B appendDecimal(long value, int decimalPlaces) throws BufferOverflowException, IllegalStateException, ArithmeticException, IllegalArgumentException
value
- to appenddecimalPlaces
- to shift the decimal placeBufferOverflowException
- 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 bufferIllegalStateException
ArithmeticException
IllegalArgumentException
@NotNull default B append(float f) throws BufferOverflowException, IllegalStateException
f
- the float number to appendBufferOverflowException
- if the relative append operation exceeds the underlying buffer's capacityIllegalStateException
- if the underlying Bytes was closed@NotNull default B append(double d) throws BufferOverflowException, IllegalStateException
d
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceedednet.openhft.chronicle.core.io.IORuntimeException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
IllegalStateException
@NotNull default B append(double d, int decimalPlaces) throws BufferOverflowException, IllegalArgumentException, IllegalStateException, ArithmeticException
If the number would normally be printed with more decimal places, the number is rounded.
d
- to appenddecimalPlaces
- to always produceBufferUnderflowException
- if the capacity of the underlying buffer was exceedednet.openhft.chronicle.core.io.IORuntimeException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
IllegalArgumentException
IllegalStateException
ArithmeticException
@NotNull default B append(@NotNull @NotNull CharSequence cs, int start, int end) throws IndexOutOfBoundsException
append
in interface Appendable
cs
- 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 range@NotNull default B append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
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 exceededIndexOutOfBoundsException
IllegalStateException
default B append8bit(@NotNull @NotNull BytesStore bs) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
bs
- the specified BytesStore to appendBufferOverflowException
- if the BytesStore is too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIllegalStateException
- if the BytesStore is closeddefault B append8bit(@NotNull @NotNull String cs) throws BufferOverflowException, IllegalStateException
cs
- the specified string to appendBufferOverflowException
- if the string is too large to write in the capacity availableIllegalStateException
- if the underlying BytesStore is closeddefault B append8bit(@NotNull @NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
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
IllegalStateException
default B append8bit(@NotNull @NotNull BytesStore bs, long start, long end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
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 rangeIllegalStateException
- if the underlying Bytes is closed@NotNull default B appendDateMillis(long dateInMillis) throws BufferOverflowException, IllegalStateException
dateInMillis
- the specified long to convert to date and append to thisBufferOverflowException
- if the relative append operation exceeds the underlying buffer's capacityIllegalStateException
- if the underlying Bytes is closed@NotNull default B appendTimeMillis(long timeOfDayInMillis) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
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 capacityIllegalStateException
- if the underlying Bytes is closedIllegalArgumentException
- if an illegal argument is passed to the method@NotNull default B append(@NotNull @NotNull BigDecimal bigDecimal)
The string representation of the BigDecimal number is a standard canonical string form as
described in BigDecimal.toString()
.
bigDecimal
- the specified BigDecimal to appendBigDecimal
default long start()
default long capacity()
default long readPosition()
The read position is start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
If the resource is closed, the returned value is unspecified.
default long writePosition()
readPosition() <= writePosition() && writePosition() <= writeLimit()
If the resource is closed, the returned value is unspecified.
default long lengthWritten(long startPosition)
If the resource is closed, the returned value is unspecified.
startPosition
- to compare againstdefault long readRemaining()
If the resource is closed, the returned value is unspecified.
default long realReadRemaining()
If the resource is closed, the returned value is unspecified.
default long writeRemaining()
If the resource is closed, the returned value is unspecified.
default long realWriteRemaining()
If the resource is closed, the returned value is unspecified.
default long readLimit()
If the resource is closed, the returned value is unspecified.
default long writeLimit()
If the resource is closed, the returned value is unspecified.
long addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferUnderflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
default long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferOverflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
long addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
default ByteOrder byteOrder()
@NotNull @NotNull Bytes<?> bytesForRead() throws IllegalStateException
IllegalStateException
@NotNull @NotNull Bytes<?> bytesForWrite() throws IllegalStateException
IllegalStateException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2022. All rights reserved.