public interface ByteStringAppender<B extends ByteStringAppender<B>> extends StreamingDataOutput<B>, Appendable
Modifier and Type | Method and Description |
---|---|
long |
address(long offset)
Obtain the underlying address.
|
default B |
append(char ch)
Append a char in UTF-8
|
default B |
append(CharSequence cs)
Append a characters in UTF-8
|
default B |
append(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(float f)
Append a float in decimal notation
|
default B |
append(long value)
Append a long in decimal
|
default B |
append8bit(CharSequence cs)
Append a String to the Bytes in ISO-8859-1
|
default B |
append8bit(CharSequence cs,
int start,
int end)
Append a portion of a String to the Bytes in ISO-8859-1
|
default B |
appendDateMillis(long dateInMillis) |
default B |
appendTimeMillis(long timeOfDayInMillis) |
default ByteOrder |
byteOrder() |
Bytes |
bytesForRead() |
Bytes |
bytesForWrite() |
default long |
capacity() |
S |
clear()
Set the readPosition= writePosition = start, writeLimit = 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.
|
default long |
readLimit() |
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
default long |
readRemaining() |
default long |
start() |
default long |
writeLimit() |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default Writer |
writer() |
default long |
writeRemaining() |
appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, nativeWrite, outputStream, write, write, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBoolean, writeByte, writeDouble, writeEnum, writeFloat, writeInt, writeLimit, writeLong, writeOrderedInt, writeOrderedLong, writePosition, writeShort, writeSkip, writeStopBit, writeStopBit, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUTFΔ
default Writer writer()
@NotNull default B append(char ch) throws BufferOverflowException, IOException
append
in interface Appendable
ch
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIOException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
@NotNull default B append(@NotNull CharSequence cs) throws BufferOverflowException, IOException
append
in interface Appendable
cs
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIOException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
@NotNull default B append(long value) throws BufferOverflowException, IORuntimeException
value
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIORuntimeException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
@NotNull default B append(float f) throws BufferOverflowException, IORuntimeException
f
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIORuntimeException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
@NotNull default B append(double d) throws BufferOverflowException, IORuntimeException
d
- to appendBufferUnderflowException
- if the capacity of the underlying buffer was exceededIORuntimeException
- if an error occurred while attempting to resize the underlying bufferBufferOverflowException
@NotNull default B append(@NotNull CharSequence cs, int start, int end) throws IndexOutOfBoundsException, BufferOverflowException, IOException
append
in interface Appendable
cs
- to copystart
- index of the first char inclusiveend
- index of the last char exclusive.BufferUnderflowException
- if the capacity of the underlying buffer was exceededIOException
- if an error occurred while attempting to resize the underlying bufferIndexOutOfBoundsException
BufferOverflowException
@NotNull default B append8bit(@NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IORuntimeException
cs
- to writeBufferOverflowException
- If the string as too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIORuntimeException
- if an error occurred while attempting to resize the underlying bufferdefault B append8bit(@NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IORuntimeException
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 exceededIORuntimeException
- if an error occurred while attempting to resize the underlying bufferIndexOutOfBoundsException
- if the start or the end are not valid for the CharSequenceIllegalArgumentException
default B appendDateMillis(long dateInMillis)
default B appendTimeMillis(long timeOfDayInMillis)
@NotNull S clear()
default long start()
default long capacity()
default long readPosition()
default long writePosition()
default long readRemaining()
default long writeRemaining()
default long readLimit()
default long writeLimit()
long address(long offset) throws UnsupportedOperationException, IllegalArgumentException
offset
- within this buffer. address(start()) is the actual address of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapIllegalArgumentException
- if the offset is before the start() or the after the capacity()default ByteOrder byteOrder()
Bytes bytesForRead() throws IllegalStateException
IllegalStateException
Bytes bytesForWrite() throws IllegalStateException
IllegalStateException
boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
Copyright © 2015. All rights reserved.