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) |
default B |
append(boolean flag)
Append a boolean as T or F
|
default B |
append(char ch)
Append 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)
Append a portion of a String to the Bytes in UTF-8.
|
default B |
append(double d)
Append a double in decimal notation
|
default B |
append(double d,
int decimalPlaces)
Append a double in decimal notation to a specific number of decimal places.
|
default B |
append(float f)
Append a float in decimal notation
|
default B |
append(int value)
Append an int in decimal
|
default B |
append(long value)
Append a long in decimal
|
default B |
append8bit(@NotNull BytesStore bs) |
default B |
append8bit(@NotNull BytesStore bs,
long start,
long end) |
default B |
append8bit(@NotNull CharSequence cs)
Append a String to the Bytes in ISO-8859-1
|
default B |
append8bit(@NotNull CharSequence cs,
int start,
int end)
Append a portion of a String to the Bytes in ISO-8859-1
|
default B |
append8bit(@NotNull String cs) |
default B |
appendBase(long value,
int base) |
default B |
appendBase16(long value) |
default B |
appendBase16(long value,
int minDigits) |
default B |
appendDateMillis(long dateInMillis) |
default B |
appendDecimal(long value,
int decimalPlaces)
Append a long in decimal with a given number of decimal places.
|
default B |
appendTimeMillis(long timeOfDayInMillis) |
default ByteOrder |
byteOrder() |
@NotNull Bytes |
bytesForRead() |
@NotNull Bytes |
bytesForWrite() |
default long |
capacity() |
default boolean |
compareAndSwapDouble(long offset,
double expected,
double value)
Perform a 64-bit double CAS at a given offset.
|
default boolean |
compareAndSwapFloat(long offset,
float expected,
float value)
Perform a 32-bit float CAS at a given offset.
|
boolean |
compareAndSwapInt(long offset,
int expected,
int value)
Perform a 32-bit CAS at a given offset.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
boolean |
isDirectMemory() |
default long |
readLimit() |
default long |
readPosition()
The read position must be
start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit() |
default long |
readRemaining() |
default long |
realReadRemaining() |
default long |
realWriteRemaining() |
boolean |
sharedMemory() |
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
default long |
writeLimit() |
default long |
writePosition()
The write position must be
readPosition() <= writePosition() && writePosition() <= writeLimit() |
default @NotNull Writer |
writer() |
default long |
writeRemaining() |
alignBy, 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, 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, writeUTFΔ, writeWithLength
clear
@NotNull default @NotNull Writer writer()
@NotNull default B append(char ch) throws IllegalStateException
append
in interface Appendable
ch
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIllegalStateException
@NotNull default B append(@NotNull @NotNull CharSequence cs)
append
in interface Appendable
cs
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceeded@NotNull default B append(boolean flag) throws BufferOverflowException, IllegalStateException
flag
- 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(int value) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
value
- 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
IllegalArgumentException
IllegalStateException
@NotNull default B append(long value) throws BufferOverflowException, IllegalStateException
value
- 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 appendBase(long value, int base) throws BufferOverflowException, IllegalArgumentException, IllegalStateException, IndexOutOfBoundsException
@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 place.BufferUnderflowException
- 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
ArithmeticException
IllegalArgumentException
@NotNull default B append(float f) throws BufferOverflowException, IllegalStateException
f
- 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) 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
- to copystart
- index of the first char inclusiveend
- index of the last char exclusive.BufferOverflowException
- if the capacity of the underlying buffer was exceededIndexOutOfBoundsException
@NotNull default B append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
cs
- to writeBufferOverflowException
- If the string as 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
default B append8bit(@NotNull @NotNull String cs) throws BufferOverflowException, IllegalStateException
default B append8bit(@NotNull @NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
cs
- to copystart
- index of the first char inclusiveend
- index of the last char exclusive.BufferOverflowException
- If the string as 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
@NotNull default B appendDateMillis(long dateInMillis) throws BufferOverflowException, IllegalStateException
@NotNull default B appendTimeMillis(long timeOfDayInMillis) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
@NotNull default B append(@NotNull @NotNull BigDecimal bigDecimal)
default long start()
default long capacity()
default long readPosition()
start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
default long writePosition()
readPosition() <= writePosition() && writePosition() <= writeLimit()
default long readRemaining()
default long realReadRemaining()
default long writeRemaining()
default long realWriteRemaining()
default long readLimit()
default long writeLimit()
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 compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
void testAndSetInt(long offset, int expected, int value) throws BufferOverflowException, IllegalStateException
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalStateException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2021. All rights reserved.