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.
|
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
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(CharSequence cs) |
default S |
appendUtf8(CharSequence cs,
int offset,
int length) |
default S |
appendUtf8(int codepoint) |
default ByteOrder |
byteOrder() |
Bytes |
bytesForRead() |
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.
|
default void |
copyFrom(InputStream input) |
boolean |
isDirectMemory() |
void |
nativeWrite(long address,
long size)
This is an expert level method for writing out data to native memory.
|
default OutputStream |
outputStream() |
default long |
readLimit() |
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
default long |
readRemaining() |
long |
realCapacity() |
boolean |
sharedMemory() |
default long |
start() |
default S |
write(byte[] bytes) |
S |
write(byte[] bytes,
int offset,
int length)
Write all data or fail.
|
default S |
write(BytesStore bytes)
Write all data or fail.
|
default S |
write(BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
default S |
write(CharSequence cs) |
default S |
write(CharSequence s,
int start,
int length) |
default S |
write8bit(BytesStore bs) |
default S |
write8bit(CharSequence cs) |
default S |
write8bit(CharSequence s,
int start,
int length) |
default S |
write8bit(String s) |
default void |
writeBigDecimal(BigDecimal bd) |
default void |
writeBigInteger(BigInteger bi) |
default S |
writeBoolean(boolean flag) |
S |
writeByte(byte i8) |
S |
writeDouble(double d) |
default <E extends Enum<E>> |
writeEnum(E e) |
S |
writeFloat(float f) |
default void |
writeHistogram(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 readPosition.
|
S |
writeSome(ByteBuffer buffer) |
default S |
writeSome(Bytes bytes) |
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 |
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(BytesStore 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 @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 Bytes@NotNull @NotNull default OutputStream outputStream()
@NotNull @NotNull default S writeStopBit(long x) throws BufferOverflowException
x
- long to writeBufferOverflowException
@NotNull @NotNull default S writeStopBit(double d) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeStopBitDecimal(double d) throws BufferOverflowException
BufferOverflowException
@NotNull @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 @NotNull default S writeUtf8(String s) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull @Deprecated default S writeUTFΔ(CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S write8bit(@Nullable CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S write8bit(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
@NotNull @NotNull default S write(CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException
@NotNull @NotNull default S write(@NotNull @NotNull CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
@NotNull @NotNull default S write8bit(@Nullable String s) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S write8bit(@Nullable BytesStore bs) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeByte(byte i8) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S writeUnsignedByte(int i) throws BufferOverflowException, IllegalArgumentException
@NotNull @NotNull S writeShort(short i16) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S writeUnsignedShort(int u16) throws BufferOverflowException, IllegalArgumentException
@NotNull @NotNull default S writeInt24(int i) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeInt(int i) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeIntAdv(int i, int advance) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S writeUnsignedInt(long i) throws BufferOverflowException, IllegalArgumentException
@NotNull @NotNull S writeLong(long i64) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeLongAdv(long i64, int advance) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeFloat(float f) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeDouble(double d) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S write(@NotNull @NotNull BytesStore bytes)
long realCapacity()
@NotNull @NotNull default S write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException
@NotNull @NotNull default S write(@NotNull @NotNull byte[] bytes) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S write(byte[] bytes, int offset, int length) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeSome(ByteBuffer buffer) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S writeBoolean(boolean flag) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeOrderedInt(int i) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull S writeOrderedLong(long i) throws BufferOverflowException
BufferOverflowException
void nativeWrite(long address, long size) throws BufferOverflowException
address
- to write to.size
- in bytes.BufferOverflowException
default <E extends Enum<E>> void writeEnum(@NotNull @NotNull E e) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S appendUtf8(@NotNull @NotNull CharSequence cs) throws BufferOverflowException
BufferOverflowException
@NotNull @NotNull default S appendUtf8(int codepoint) throws BufferOverflowException
BufferOverflowException
@NotNull default S appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@NotNull @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(BytesStore 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()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()default ByteOrder byteOrder()
@NotNull Bytes bytesForRead() throws IllegalStateException
IllegalStateException
@NotNull Bytes bytesForWrite() throws IllegalStateException
IllegalStateException
boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
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 © 2017. All rights reserved.