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)
Deprecated.
|
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() |
default @NotNull OutputStream |
outputStream() |
default S |
rawWriteByte(byte i8) |
default S |
rawWriteInt(int i) |
default S |
rawWriteLong(long i)
Write a long without a bounds check
|
default long |
readLimit() |
default long |
readPosition()
The read position must be
start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit() |
default long |
readRemaining() |
long |
realCapacity() |
default long |
realReadRemaining() |
default long |
realWriteRemaining() |
boolean |
sharedMemory() |
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
default S |
unsafeWrite(long address,
int length)
Write raw native memory for a ifixed length
|
default S |
unsafeWriteObject(Object o,
int length) |
default S |
unsafeWriteObject(Object o,
int offset,
int length) |
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)
Writes all the the passed BytesStore or it fails.
|
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) |
S |
write8bit(@NotNull String s,
int start,
int length) |
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)
Write a long
|
S |
writeLongAdv(long i64,
int advance) |
S |
writeOrderedInt(int i) |
S |
writeOrderedLong(long i) |
default long |
writePosition()
The write position must be
readPosition() <= writePosition() && writePosition() <= writeLimit() |
S |
writePosition(long position) |
default long |
writePositionForHeader(boolean skipPadding)
obtain the writePosition skipping any padding needed for a header.
|
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, IllegalStateException
bytesToSkip
- bytes to skip. This can be negative.BufferOverflowException
- if the offset is outside the limits of the BytesIllegalStateException
@Deprecated default S alignBy(int width) throws BufferOverflowException, IllegalStateException
default long writePositionForHeader(boolean skipPadding)
skipPadding
- optional aligning to 4 bytes@NotNull default @NotNull OutputStream outputStream()
@NotNull default S writeStopBit(long x) throws BufferOverflowException, IllegalStateException
x
- long to writeBufferOverflowException
IllegalStateException
@NotNull default S writeStopBit(char x) throws BufferOverflowException, IllegalStateException
@NotNull default S writeStopBit(double d) throws BufferOverflowException, IllegalStateException
@NotNull default S writeStopBitDecimal(double d) throws BufferOverflowException, IllegalStateException
@NotNull default S writeUtf8(CharSequence cs) throws BufferOverflowException, IllegalStateException, IllegalArgumentException, BufferUnderflowException
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 leftIllegalStateException
IllegalArgumentException
BufferUnderflowException
@NotNull default S writeUtf8(String s) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, IllegalArgumentException
@NotNull @Deprecated default S writeUTFΔ(CharSequence cs) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, IllegalArgumentException
@NotNull default S write8bit(@Nullable @Nullable CharSequence cs) throws BufferOverflowException, ArithmeticException, IllegalStateException, BufferUnderflowException
@NotNull default S write8bit(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IndexOutOfBoundsException, ArithmeticException, IllegalStateException, BufferUnderflowException
@NotNull default S write(CharSequence cs) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException
@NotNull default S write(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException
@NotNull default S write8bit(@Nullable @Nullable String s) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull default S write8bit(@Nullable @Nullable BytesStore bs) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
@NotNull S writeByte(byte i8) throws BufferOverflowException, IllegalStateException
default S rawWriteByte(byte i8) throws BufferOverflowException, IllegalStateException
@NotNull default S writeUnsignedByte(int i) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull default S writeChar(char ch) throws BufferOverflowException, IllegalStateException
@NotNull S writeShort(short i16) throws BufferOverflowException, IllegalStateException
@NotNull default S writeUnsignedShort(int u16) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull default S writeInt24(int i) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull default S writeUnsignedInt24(int i) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull S writeInt(int i) throws BufferOverflowException, IllegalStateException
default S rawWriteInt(int i) throws BufferOverflowException, IllegalStateException
@NotNull S writeIntAdv(int i, int advance) throws BufferOverflowException, IllegalStateException
@NotNull default S writeUnsignedInt(long i) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull S writeLong(long i64) throws BufferOverflowException, IllegalStateException
default S rawWriteLong(long i) throws BufferOverflowException, IllegalStateException
@NotNull S writeLongAdv(long i64, int advance) throws BufferOverflowException, IllegalStateException
@NotNull S writeFloat(float f) throws BufferOverflowException, IllegalStateException
@NotNull S writeDouble(double d) throws BufferOverflowException, IllegalStateException
@NotNull S writeDoubleAndInt(double d, int i) throws BufferOverflowException, IllegalStateException
@NotNull default S write(@NotNull @NotNull RandomDataInput bytes) throws BufferOverflowException, IllegalStateException
default S write(@NotNull @NotNull BytesStore bytes) throws BufferOverflowException, IllegalStateException
bytes
- to writeBufferOverflowException
IllegalStateException
StreamingDataInput.read(Bytes)
long realCapacity()
default boolean canWriteDirect(long count)
@NotNull default S writeSome(@NotNull @NotNull Bytes bytes) throws IllegalStateException
IllegalStateException
@NotNull default S write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
@NotNull default S write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
@NotNull default S write(@NotNull @NotNull byte[] bytes) throws BufferOverflowException, IllegalStateException
@NotNull S write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalStateException, IllegalArgumentException, ArrayIndexOutOfBoundsException
default S unsafeWriteObject(Object o, int length) throws BufferOverflowException, IllegalStateException
default S unsafeWriteObject(Object o, int offset, int length) throws BufferOverflowException, IllegalStateException
default S unsafeWrite(long address, int length)
@NotNull S writeSome(ByteBuffer buffer) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
@NotNull default S writeBoolean(boolean flag) throws BufferOverflowException, IllegalStateException
@NotNull S writeOrderedInt(int i) throws BufferOverflowException, IllegalStateException
@NotNull S writeOrderedLong(long i) throws BufferOverflowException, IllegalStateException
default <E extends Enum<E>> S writeEnum(@NotNull E e) throws BufferOverflowException, ArithmeticException, IllegalStateException
@NotNull default S appendUtf8(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, IllegalStateException, BufferUnderflowException
@NotNull default S appendUtf8(int codepoint) throws BufferOverflowException, IllegalStateException
@NotNull default S appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, IllegalArgumentException
@NotNull default S appendUtf8(@NotNull @NotNull CharSequence cs, int offset, int length) throws BufferOverflowException, IndexOutOfBoundsException, IllegalStateException, BufferUnderflowException
@NotNull default S appendUtf8(byte[] bytes, int offset, int length, byte coder) throws BufferOverflowException, IllegalStateException
@NotNull default S appendUtf8(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalStateException
default void copyFrom(@NotNull @NotNull InputStream input) throws IOException, BufferOverflowException, IllegalStateException
default void writePositionRemaining(long position, long length) throws BufferOverflowException
BufferOverflowException
default void writeHistogram(@NotNull @NotNull net.openhft.chronicle.core.util.Histogram histogram) throws BufferOverflowException, IllegalStateException
default void writeBigDecimal(@NotNull @NotNull BigDecimal bd) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
default void writeBigInteger(@NotNull @NotNull BigInteger bi) throws BufferOverflowException, IllegalStateException, IllegalArgumentException
default void writeWithLength(RandomDataInput bytes) throws BufferOverflowException, IllegalStateException
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.