public interface StreamingDataOutput<S extends StreamingDataOutput<S>> extends StreamingCommon<S>
The use of this instance is single threaded, though the use of the data
Modifier and Type | Field and Description |
---|---|
static int |
JAVA9_STRING_CODER_LATIN |
static int |
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 S |
alignBy(int width) |
default S |
appendUtf8(byte[] bytes,
int offset,
int length) |
default S |
appendUtf8(byte[] bytes,
int offset,
int length,
byte coder) |
default S |
appendUtf8(char[] chars,
int offset,
int length) |
default S |
appendUtf8(@NotNull CharSequence cs) |
default S |
appendUtf8(@NotNull CharSequence cs,
int offset,
int length) |
default S |
appendUtf8(int codepoint) |
default ByteOrder |
byteOrder() |
@NotNull Bytes |
bytesForRead() |
@NotNull Bytes |
bytesForWrite() |
default boolean |
canWriteDirect(long count) |
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.
|
default void |
copyFrom(@NotNull InputStream input) |
boolean |
isDirectMemory() |
void |
nativeWrite(long address,
long size)
Deprecated.
|
default @NotNull OutputStream |
outputStream() |
default S |
rawWriteByte(byte i8) |
default S |
rawWriteInt(int i) |
default long |
readLimit() |
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
default long |
readRemaining() |
long |
realCapacity() |
long |
realWriteRemaining() |
boolean |
sharedMemory() |
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
default S |
write(@NotNull byte[] bytes) |
S |
write(byte[] bytes,
int offset,
int length)
Write all data or fail.
|
default S |
write(@NotNull BytesStore bytes) |
default S |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
default S |
write(CharSequence cs) |
default S |
write(@NotNull CharSequence s,
int start,
int length) |
default S |
write(@NotNull RandomDataInput bytes)
Write all data or fail.
|
default S |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
default S |
write8bit(@Nullable BytesStore bs) |
default S |
write8bit(@Nullable CharSequence cs) |
default S |
write8bit(@NotNull CharSequence s,
int start,
int length) |
default S |
write8bit(@Nullable String s) |
default void |
writeBigDecimal(@NotNull BigDecimal bd) |
default void |
writeBigInteger(@NotNull BigInteger bi) |
default S |
writeBoolean(boolean flag) |
S |
writeByte(byte i8) |
default S |
writeChar(char ch) |
S |
writeDouble(double d) |
S |
writeDoubleAndInt(double d,
int i) |
default <E extends Enum<E>> |
writeEnum(E e) |
S |
writeFloat(float f) |
default void |
writeHistogram(@NotNull net.openhft.chronicle.core.util.Histogram histogram) |
S |
writeInt(int i) |
default S |
writeInt24(int i) |
S |
writeIntAdv(int i,
int advance) |
default long |
writeLimit() |
S |
writeLimit(long limit) |
S |
writeLong(long i64) |
S |
writeLongAdv(long i64,
int advance) |
S |
writeOrderedInt(int i) |
S |
writeOrderedLong(long i) |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
S |
writePosition(long position) |
default void |
writePositionRemaining(long position,
long length) |
default long |
writeRemaining() |
S |
writeShort(short i16) |
S |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
S |
writeSome(ByteBuffer buffer) |
default S |
writeSome(@NotNull Bytes bytes) |
default S |
writeStopBit(char x) |
default S |
writeStopBit(double d) |
default S |
writeStopBit(long x)
Write a stop bit encoded long
|
default S |
writeStopBitDecimal(double d) |
default S |
writeUnsignedByte(int i) |
default S |
writeUnsignedInt(long i) |
default S |
writeUnsignedInt24(int i) |
default S |
writeUnsignedShort(int u16) |
default S |
writeUtf8(CharSequence cs)
Write the same encoding as
writeUTF with the following changes. |
default S |
writeUtf8(String s) |
default S |
writeUTFΔ(CharSequence cs)
Deprecated.
|
default void |
writeWithLength(RandomDataInput bytes) |
clear
static final int JAVA9_STRING_CODER_LATIN
static final int JAVA9_STRING_CODER_UTF16
@NotNull S writePosition(long position) throws BufferOverflowException
BufferOverflowException
@NotNull S writeLimit(long limit) throws BufferOverflowException
BufferOverflowException
@NotNull S writeSkip(long bytesToSkip) throws BufferOverflowException
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the Bytesdefault S alignBy(int width)
@NotNull default @NotNull OutputStream outputStream()
@NotNull default S writeStopBit(long x) throws BufferOverflowException
x
- long to writeBufferOverflowException
@NotNull default S writeStopBit(char x) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeStopBit(double d) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeStopBitDecimal(double d) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUtf8(CharSequence cs) throws BufferOverflowException
writeUTF
with the following changes. 1) The length is stop bit encoded
i.e. one byte longer for short strings, but is not limited in length. 2) The string can be null.cs
- the string value to be written. Can be null.BufferOverflowException
- if there is not enough space left@NotNull default S writeUtf8(String s) throws BufferOverflowException
BufferOverflowException
@NotNull @Deprecated default S writeUTFΔ(CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull default S write8bit(@Nullable @Nullable CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull default S write8bit(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
@NotNull default S write(CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException
@NotNull default S write(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
@NotNull default S write8bit(@Nullable @Nullable String s) throws BufferOverflowException
BufferOverflowException
@NotNull default S write8bit(@Nullable @Nullable BytesStore bs) throws BufferOverflowException
BufferOverflowException
@NotNull S writeByte(byte i8) throws BufferOverflowException
BufferOverflowException
default S rawWriteByte(byte i8) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedByte(int i) throws BufferOverflowException, IllegalArgumentException
@NotNull default S writeChar(char ch)
@NotNull S writeShort(short i16) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedShort(int u16) throws BufferOverflowException, IllegalArgumentException
@NotNull default S writeInt24(int i) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedInt24(int i) throws BufferOverflowException
BufferOverflowException
@NotNull S writeInt(int i) throws BufferOverflowException
BufferOverflowException
default S rawWriteInt(int i) throws BufferOverflowException
BufferOverflowException
@NotNull S writeIntAdv(int i, int advance) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedInt(long i) throws BufferOverflowException, IllegalArgumentException
@NotNull S writeLong(long i64) throws BufferOverflowException
BufferOverflowException
@NotNull S writeLongAdv(long i64, int advance) throws BufferOverflowException
BufferOverflowException
@NotNull S writeFloat(float f) throws BufferOverflowException
BufferOverflowException
@NotNull S writeDouble(double d) throws BufferOverflowException
BufferOverflowException
@NotNull S writeDoubleAndInt(double d, int i) throws BufferOverflowException
BufferOverflowException
@NotNull default S write(@NotNull @NotNull RandomDataInput bytes)
default S write(@NotNull @NotNull BytesStore bytes)
long realCapacity()
long realWriteRemaining()
default boolean canWriteDirect(long count)
@NotNull default S write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException
@NotNull default S write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException
@NotNull default S write(@NotNull @NotNull byte[] bytes) throws BufferOverflowException
BufferOverflowException
@NotNull S write(byte[] bytes, int offset, int length) throws BufferOverflowException
BufferOverflowException
@NotNull S writeSome(ByteBuffer buffer) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeBoolean(boolean flag) throws BufferOverflowException
BufferOverflowException
@NotNull S writeOrderedInt(int i) throws BufferOverflowException
BufferOverflowException
@NotNull S writeOrderedLong(long i) throws BufferOverflowException
BufferOverflowException
@Deprecated void nativeWrite(long address, long size) throws BufferOverflowException
address
- to write to.size
- in bytes.BufferOverflowException
default <E extends Enum<E>> S writeEnum(@NotNull E e) throws BufferOverflowException
BufferOverflowException
@NotNull default S appendUtf8(@NotNull @NotNull CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull default S appendUtf8(int codepoint) throws BufferOverflowException
BufferOverflowException
@NotNull default S appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@NotNull default S appendUtf8(@NotNull @NotNull CharSequence cs, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@NotNull default S appendUtf8(byte[] bytes, int offset, int length, byte coder) throws BufferOverflowException, IllegalArgumentException
@NotNull default S appendUtf8(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException
default void copyFrom(@NotNull @NotNull InputStream input) throws IOException, BufferOverflowException, IllegalArgumentException
default void writePositionRemaining(long position, long length)
default void writeHistogram(@NotNull @NotNull net.openhft.chronicle.core.util.Histogram histogram)
default void writeBigDecimal(@NotNull @NotNull BigDecimal bd)
default void writeBigInteger(@NotNull @NotNull BigInteger bi)
default void writeWithLength(RandomDataInput bytes)
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 addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException
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()default long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException
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()long addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException
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
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
void testAndSetInt(long offset, int expected, int value)
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2020. All rights reserved.