public interface StreamingDataInput<S extends StreamingDataInput<S>> extends StreamingCommon<S>
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 ByteOrder |
byteOrder() |
@NotNull Bytes |
bytesForRead() |
@NotNull 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.
|
long |
copyTo(BytesStore to) |
void |
copyTo(OutputStream out) |
default @NotNull InputStream |
inputStream() |
boolean |
isDirectMemory() |
boolean |
lenient() |
void |
lenient(boolean lenient)
When there is no more data to read, return zero, false and empty string.
|
void |
nativeRead(long address,
long size)
Deprecated.
|
default long |
parseHexLong() |
default void |
parseUTF(Appendable sb,
int length)
Deprecated.
|
default void |
parseUtf8(Appendable sb,
boolean utf,
int length) |
default void |
parseUtf8(Appendable sb,
int encodedLength) |
int |
peekUnsignedByte() |
default byte |
rawReadByte() |
default int |
rawReadInt() |
default long |
rawReadLong() |
default int |
read(@NotNull byte[] bytes) |
default int |
read(@NotNull byte[] bytes,
int off,
int len) |
default void |
read(@NotNull ByteBuffer buffer) |
default void |
read(@NotNull Bytes bytes,
int length) |
default int |
read(@NotNull char[] bytes,
int off,
int len) |
default @Nullable String |
read8bit() |
default <ACS extends Appendable & CharSequence> |
read8bit(ACS sb) |
default boolean |
read8bit(@NotNull Bytes b) |
default boolean |
read8bit(@NotNull StringBuilder sb) |
default boolean |
readBoolean() |
byte |
readByte() |
default char |
readChar() |
double |
readDouble() |
default <E extends Enum<E>> |
readEnum(@NotNull Class<E> eClass) |
float |
readFloat() |
default void |
readHistogram(@NotNull net.openhft.chronicle.core.util.Histogram histogram) |
default long |
readIncompleteLong() |
int |
readInt() |
default int |
readInt24() |
default long |
readLimit() |
S |
readLimit(long limit) |
default S |
readLimitToCapacity() |
long |
readLong() |
default long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
S |
readPosition(long position) |
default S |
readPositionRemaining(long position,
long remaining) |
default S |
readPositionUnlimited(long position) |
default long |
readRemaining() |
short |
readShort() |
S |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
default long |
readStopBit() |
default char |
readStopBitChar() |
default double |
readStopBitDecimal() |
default double |
readStopBitDouble() |
int |
readUnsignedByte() |
default long |
readUnsignedInt() |
default int |
readUnsignedInt24() |
default int |
readUnsignedShort() |
default @Nullable String |
readUtf8()
The same as readUTF() except the length is stop bit encoded.
|
default <ACS extends Appendable & CharSequence> |
readUtf8(ACS sb)
The same as readUtf8() except the chars are copied to a truncated StringBuilder.
|
default @Nullable String |
readUTFΔ()
Deprecated.
|
default <ACS extends Appendable & CharSequence> |
readUTFΔ(ACS sb)
Deprecated.
|
int |
readVolatileInt() |
long |
readVolatileLong() |
default void |
readWithLength(Bytes bytes) |
default void |
readWithLength(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumer<S,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer)
Perform a set of actions with a temporary bounds mode.
|
default void |
readWithLength0(long length,
@NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<S,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer,
StringBuilder sb,
BytesOut toBytes)
Perform a set of actions with a temporary bounds mode.
|
default long |
realCapacity() |
boolean |
sharedMemory() |
default long |
start() |
void |
testAndSetInt(long offset,
int expected,
int value) |
void |
uncheckedReadSkipBackOne()
Read skip -1 when you are sure this is safe.
|
void |
uncheckedReadSkipOne()
Read skip 1 when you are sure this is safe.
|
int |
uncheckedReadUnsignedByte() |
default void |
unsafeReadObject(Object o,
int length) |
default void |
unsafeReadObject(Object o,
int offset,
int length) |
default long |
writeLimit() |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default long |
writeRemaining() |
clear
@NotNull S readPosition(long position) throws BufferUnderflowException
BufferUnderflowException
@NotNull default S readPositionUnlimited(long position) throws BufferUnderflowException
BufferUnderflowException
@NotNull default S readPositionRemaining(long position, long remaining) throws BufferUnderflowException
BufferUnderflowException
@NotNull S readLimit(long limit) throws BufferUnderflowException
BufferUnderflowException
default S readLimitToCapacity() throws BufferUnderflowException
BufferUnderflowException
@NotNull S readSkip(long bytesToSkip) throws BufferUnderflowException
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the Bytesvoid uncheckedReadSkipOne()
void uncheckedReadSkipBackOne()
default void readWithLength0(long length, @NotNull @NotNull net.openhft.chronicle.core.util.ThrowingConsumerNonCapturing<S,net.openhft.chronicle.core.io.IORuntimeException,BytesOut> bytesConsumer, StringBuilder sb, BytesOut toBytes) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
default void readWithLength(long length, @NotNull @NotNull net.openhft.chronicle.core.util.ThrowingConsumer<S,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull default @NotNull InputStream inputStream()
default long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default char readStopBitChar() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default double readStopBitDouble()
default double readStopBitDecimal() throws BufferOverflowException
BufferOverflowException
default boolean readBoolean()
byte readByte()
default byte rawReadByte()
default char readChar()
int readUnsignedByte()
int uncheckedReadUnsignedByte()
short readShort() throws BufferUnderflowException
BufferUnderflowException
default int readUnsignedShort() throws BufferUnderflowException
BufferUnderflowException
default int readInt24() throws BufferUnderflowException
BufferUnderflowException
default int readUnsignedInt24() throws BufferUnderflowException
BufferUnderflowException
int readInt() throws BufferUnderflowException
BufferUnderflowException
default int rawReadInt()
default long readUnsignedInt() throws BufferUnderflowException
BufferUnderflowException
long readLong() throws BufferUnderflowException
BufferUnderflowException
default long rawReadLong()
default long readIncompleteLong()
float readFloat() throws BufferUnderflowException
BufferUnderflowException
double readDouble() throws BufferUnderflowException
BufferUnderflowException
@Nullable default @Nullable String readUtf8() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException
null
values are also supportednull
if writeUtf8(null)
was calledBufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
@Nullable @Deprecated default @Nullable String readUTFΔ() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalArgumentException
@Nullable default @Nullable String read8bit() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
default <ACS extends Appendable & CharSequence> boolean readUtf8(@NotNull ACS sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException
sb
- to copy chars totrue
if there was a String, or false
if it was null
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
@Deprecated default <ACS extends Appendable & CharSequence> boolean readUTFΔ(@NotNull ACS sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
default boolean read8bit(@NotNull @NotNull Bytes b) throws BufferUnderflowException, IllegalStateException, BufferOverflowException
default <ACS extends Appendable & CharSequence> boolean read8bit(@NotNull ACS sb) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
BufferUnderflowException
default boolean read8bit(@NotNull @NotNull StringBuilder sb) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
default int read(@NotNull @NotNull byte[] bytes)
default int read(@NotNull @NotNull byte[] bytes, int off, int len)
default int read(@NotNull @NotNull char[] bytes, int off, int len)
default void read(@NotNull @NotNull ByteBuffer buffer)
default void read(@NotNull @NotNull Bytes bytes, int length)
default void unsafeReadObject(Object o, int length)
default void unsafeReadObject(Object o, int offset, int length)
int readVolatileInt() throws BufferUnderflowException
BufferUnderflowException
long readVolatileLong() throws BufferUnderflowException
BufferUnderflowException
int peekUnsignedByte()
@Deprecated void nativeRead(long address, long size) throws BufferUnderflowException
address
- of the memory.size
- in bytes.BufferUnderflowException
@NotNull default <E extends Enum<E>> E readEnum(@NotNull @NotNull Class<E> eClass) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
@Deprecated default void parseUTF(Appendable sb, int length) throws IllegalArgumentException, BufferUnderflowException, UTFDataFormatRuntimeException
default void parseUtf8(Appendable sb, int encodedLength) throws IllegalArgumentException, BufferUnderflowException, UTFDataFormatRuntimeException
default void parseUtf8(Appendable sb, boolean utf, int length) throws IllegalArgumentException, BufferUnderflowException, UTFDataFormatRuntimeException
default long parseHexLong()
void copyTo(OutputStream out) throws IOException
IOException
long copyTo(BytesStore to)
default void readHistogram(@NotNull @NotNull net.openhft.chronicle.core.util.Histogram histogram)
default void readWithLength(Bytes bytes)
void lenient(boolean lenient)
lenient
- if true, return nothing rather than error.boolean lenient()
default long start()
default long capacity()
default long realCapacity()
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.