public interface StreamingDataInput<S extends StreamingDataInput<S>>
Modifier and Type | Method and Description |
---|---|
long |
address(long offset)
Obtain the underlying address.
|
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.
|
long |
copyTo(BytesStore to) |
void |
copyTo(OutputStream out) |
default InputStream |
inputStream() |
boolean |
isNative() |
void |
nativeRead(long address,
long size)
This is an expert level method for copying raw native memory in bulk.
|
default long |
parseHexLong() |
default void |
parseUTF(Appendable sb,
int length)
Deprecated.
|
default void |
parseUtf8(Appendable sb,
int length) |
default <R> R |
parseWithLength(long length,
java.util.function.Function<S,R> bytesConsumer) |
int |
peekUnsignedByte() |
default int |
read(byte[] bytes) |
default int |
read(byte[] bytes,
int off,
int len) |
default void |
read(ByteBuffer buffer) |
default int |
read(char[] bytes,
int off,
int len) |
default String |
read8bit() |
default <ACS extends Appendable & CharSequence> |
read8bit(ACS sb) |
default boolean |
read8bit(Bytes b) |
default boolean |
read8bit(StringBuilder sb) |
default boolean |
readBoolean() |
byte |
readByte() |
double |
readDouble() |
default <E extends Enum<E>> |
readEnum(Class<E> eClass) |
float |
readFloat() |
int |
readInt() |
default long |
readLimit() |
S |
readLimit(long limit) |
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 long |
readRemaining() |
short |
readShort() |
S |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
default long |
readStopBit() |
default double |
readStopBitDouble() |
int |
readUnsignedByte() |
default long |
readUnsignedInt() |
default int |
readUnsignedInt24() |
default int |
readUnsignedShort() |
default 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 String |
readUTFΔ()
Deprecated.
|
default <ACS extends Appendable & CharSequence> |
readUTFΔ(ACS sb)
Deprecated.
|
int |
readVolatileInt() |
long |
readVolatileLong() |
default void |
readWithLength(long length,
java.util.function.Consumer<S> bytesConsumer)
Perform a set of actions with a temporary bounds mode.
|
boolean |
sharedMemory() |
default long |
start() |
default long |
writeLimit() |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default long |
writeRemaining() |
S readPosition(long position) throws BufferUnderflowException
BufferUnderflowException
default S readPositionRemaining(long position, long remaining) throws BufferUnderflowException
BufferUnderflowException
S readLimit(long limit) throws BufferUnderflowException
BufferUnderflowException
S readSkip(long bytesToSkip) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
default void readWithLength(long length, @NotNull java.util.function.Consumer<S> bytesConsumer) throws BufferUnderflowException
BufferUnderflowException
default <R> R parseWithLength(long length, @NotNull java.util.function.Function<S,R> bytesConsumer) throws BufferUnderflowException
BufferUnderflowException
@NotNull default InputStream inputStream()
default long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default double readStopBitDouble() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default boolean readBoolean() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
byte readByte() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
int readUnsignedByte() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
short readShort() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
default int readUnsignedShort() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
default int readUnsignedInt24() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
int readInt() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
default long readUnsignedInt() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
long readLong() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
float readFloat() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
double readDouble() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
@Nullable default 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
@Deprecated default String readUTFΔ() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalArgumentException
@Nullable default 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 Bytes b) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, BufferUnderflowException, IllegalStateException, BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalArgumentException
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(StringBuilder sb) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
default int read(@NotNull byte[] bytes) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default int read(@NotNull byte[] bytes, int off, int len) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default int read(@NotNull char[] bytes, int off, int len) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default void read(@NotNull ByteBuffer buffer) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
int readVolatileInt() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
long readVolatileLong() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
int peekUnsignedByte() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
void nativeRead(long address, long size) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
address
- of the memory.size
- in bytes.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
default <E extends Enum<E>> E readEnum(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 length) throws IllegalArgumentException, BufferUnderflowException, UTFDataFormatRuntimeException
default long parseHexLong()
void copyTo(OutputStream out) throws IOException
IOException
long copyTo(BytesStore to)
@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, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
default boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
default boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
boolean isNative()
boolean sharedMemory()
Copyright © 2016. All rights reserved.