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 |
isDirectMemory() |
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) |
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 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 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,
net.openhft.chronicle.core.util.ThrowingConsumer<S,net.openhft.chronicle.core.io.IORuntimeException> bytesConsumer)
Perform a set of actions with a temporary bounds mode.
|
boolean |
sharedMemory() |
default long |
start() |
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 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 readPositionUnlimited(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
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the Bytesvoid uncheckedReadSkipOne()
void uncheckedReadSkipBackOne()
default void readWithLength(long length, @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 InputStream inputStream()
default long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
default double readStopBitDouble()
default boolean readBoolean()
byte readByte()
int readUnsignedByte()
int uncheckedReadUnsignedByte()
short readShort() throws BufferUnderflowException
BufferUnderflowException
default int readUnsignedShort() throws BufferUnderflowException
BufferUnderflowException
default int readUnsignedInt24() throws BufferUnderflowException
BufferUnderflowException
int readInt() throws BufferUnderflowException
BufferUnderflowException
default long readUnsignedInt() throws BufferUnderflowException
BufferUnderflowException
long readLong() throws BufferUnderflowException
BufferUnderflowException
float readFloat() throws BufferUnderflowException
BufferUnderflowException
double readDouble() throws BufferUnderflowException
BufferUnderflowException
@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)
default int read(@NotNull byte[] bytes, int off, int len)
default int read(@NotNull char[] bytes, int off, int len)
default void read(@NotNull ByteBuffer buffer)
int readVolatileInt() throws BufferUnderflowException
BufferUnderflowException
long readVolatileLong() throws BufferUnderflowException
BufferUnderflowException
int peekUnsignedByte()
void nativeRead(long address, long size) throws BufferUnderflowException
address
- of the memory.size
- in bytes.BufferUnderflowException
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
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.