public interface StreamingDataOutput<S extends StreamingDataOutput<S>>
The use of this instance is single threaded, though the use of the data
Modifier and Type | Method and Description |
---|---|
long |
address(long offset)
Obtain the underlying address.
|
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() |
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 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 sdi) |
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) |
default long |
writeLimit() |
S |
writeLimit(long limit) |
S |
writeLong(long i64) |
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 |
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.
|
S writePosition(long position) throws BufferOverflowException
BufferOverflowException
S writeLimit(long limit) throws BufferOverflowException
BufferOverflowException
S writeSkip(long bytesToSkip) throws BufferOverflowException
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the Bytes@NotNull default OutputStream outputStream()
@NotNull default S writeStopBit(long x) throws BufferOverflowException
x
- long to writeBufferOverflowException
default S writeStopBit(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 leftdefault S writeUtf8(String s) throws BufferOverflowException
BufferOverflowException
@Deprecated default S writeUTFΔ(CharSequence cs) throws BufferOverflowException
BufferOverflowException
default S write8bit(CharSequence cs) throws BufferOverflowException
BufferOverflowException
default S write8bit(CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
default S write(CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException
default S write(CharSequence s, int start, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException
default S write8bit(@NotNull String s) throws BufferOverflowException
BufferOverflowException
default S write8bit(@NotNull BytesStore sdi) throws BufferOverflowException
BufferOverflowException
@NotNull S writeByte(byte i8) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedByte(int i) throws BufferOverflowException, IllegalArgumentException
@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 S writeInt(int i) throws BufferOverflowException
BufferOverflowException
@NotNull default S writeUnsignedInt(long i) throws BufferOverflowException, IllegalArgumentException
@NotNull S writeLong(long i64) throws BufferOverflowException
BufferOverflowException
@NotNull S writeFloat(float f) throws BufferOverflowException
BufferOverflowException
@NotNull S writeDouble(double d) throws BufferOverflowException
BufferOverflowException
@NotNull default S write(@NotNull BytesStore bytes) throws BufferOverflowException
BufferOverflowException
long realCapacity()
@NotNull default S writeSome(@NotNull Bytes bytes) throws BufferOverflowException
BufferOverflowException
@NotNull default S write(@NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException
@NotNull default S write(@NotNull byte[] bytes) throws BufferOverflowException
BufferOverflowException
@NotNull S write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@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
void nativeWrite(long address, long size) throws BufferOverflowException
address
- to write to.size
- in bytes.BufferOverflowException
default <E extends Enum<E>> void writeEnum(E e) throws BufferOverflowException
BufferOverflowException
default S appendUtf8(CharSequence cs) throws BufferOverflowException
BufferOverflowException
default S appendUtf8(int codepoint) throws BufferOverflowException
BufferOverflowException
default S appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
default S appendUtf8(CharSequence cs, int offset, int length) throws BufferOverflowException, IllegalArgumentException
default void copyFrom(InputStream input) throws IOException, BufferOverflowException, IllegalArgumentException
default void writePositionRemaining(long position, long length)
default void writeHistogram(net.openhft.chronicle.core.util.Histogram histogram)
default void writeBigDecimal(BigDecimal bd)
default void writeBigInteger(BigInteger bi)
@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
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalArgumentException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalArgumentException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2016. All rights reserved.