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.
|
default void |
copyTo(OutputStream out) |
default InputStream |
inputStream() |
void |
nativeRead(long address,
long size)
This is an expert level method for copying raw native memory in bulk.
|
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 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 |
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.
|
default long |
start() |
default byte[] |
toByteArray() |
default long |
writeLimit() |
default long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
default long |
writeRemaining() |
S readPosition(long position) throws BufferUnderflowException
BufferUnderflowExceptionS readLimit(long limit) throws BufferUnderflowException
BufferUnderflowExceptionS readSkip(long bytesToSkip) throws BufferUnderflowException, 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.default void readWithLength(long length,
@NotNull
java.util.function.Consumer<S> bytesConsumer)
throws BufferUnderflowException
BufferUnderflowExceptiondefault <R> R parseWithLength(long length,
@NotNull
java.util.function.Function<S,R> bytesConsumer)
throws BufferUnderflowException
BufferUnderflowException@NotNull default InputStream inputStream()
default long readStopBit()
throws IORuntimeException
IORuntimeExceptiondefault double readStopBitDouble()
throws IORuntimeException
IORuntimeExceptiondefault boolean readBoolean()
throws IORuntimeException
IORuntimeExceptionbyte readByte()
throws IORuntimeException
IORuntimeExceptionint readUnsignedByte()
throws IORuntimeException
IORuntimeExceptionshort readShort()
throws BufferUnderflowException,
IORuntimeException
default int readUnsignedShort()
throws BufferUnderflowException,
IORuntimeException
int readInt()
throws BufferUnderflowException,
IORuntimeException
default long readUnsignedInt()
throws BufferUnderflowException,
IORuntimeException
long readLong()
throws BufferUnderflowException,
IORuntimeException
float readFloat()
throws BufferUnderflowException,
IORuntimeException
double readDouble()
throws BufferUnderflowException,
IORuntimeException
@Nullable default String readUtf8() throws BufferUnderflowException, IORuntimeException, IllegalArgumentException
null values are also supportednull if writeUtf8(null) was calledBufferUnderflowExceptionIORuntimeExceptionIllegalArgumentException@Deprecated default String readUTFΔ() throws IORuntimeException, BufferUnderflowException, IllegalArgumentException
@Nullable default String read8bit() throws IORuntimeException, BufferUnderflowException
default <ACS extends Appendable & CharSequence> boolean readUtf8(@NotNull ACS sb) throws IORuntimeException, IllegalArgumentException, BufferUnderflowException
sb - to copy chars totrue if there was a String, or false if it was nullIORuntimeExceptionIllegalArgumentExceptionBufferUnderflowException@Deprecated default <ACS extends Appendable & CharSequence> boolean readUTFΔ(@NotNull ACS sb) throws IORuntimeException, IllegalArgumentException, BufferUnderflowException
default boolean read8bit(@NotNull
Bytes b)
throws IORuntimeException,
IllegalArgumentException,
BufferUnderflowException,
IllegalStateException,
BufferOverflowException
default <ACS extends Appendable & CharSequence> boolean read8bit(@NotNull ACS sb) throws IORuntimeException, IllegalArgumentException, BufferUnderflowException
default boolean read8bit(StringBuilder sb) throws IORuntimeException, BufferUnderflowException
default int read(@NotNull
byte[] bytes)
throws IORuntimeException
IORuntimeExceptiondefault int read(@NotNull
byte[] bytes,
int off,
int len)
throws IORuntimeException
IORuntimeExceptiondefault int read(@NotNull
char[] bytes,
int off,
int len)
throws IORuntimeException
IORuntimeExceptiondefault void read(@NotNull
ByteBuffer buffer)
throws IORuntimeException
IORuntimeExceptionint readVolatileInt()
throws BufferUnderflowException,
IORuntimeException
long readVolatileLong()
throws BufferUnderflowException,
IORuntimeException
int peekUnsignedByte()
throws IORuntimeException
IORuntimeExceptionvoid nativeRead(long address,
long size)
throws BufferUnderflowException,
IORuntimeException
address - of the memory.size - in bytes.BufferUnderflowExceptionIORuntimeExceptiondefault <E extends Enum<E>> E readEnum(Class<E> eClass) throws 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 byte[] toByteArray()
throws IORuntimeException,
IllegalArgumentException
default void copyTo(OutputStream out) throws IOException
IOException@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
IllegalStateExceptionBytes bytesForWrite() throws IllegalStateException
IllegalStateExceptionboolean compareAndSwapInt(long offset,
int expected,
int value)
throws BufferOverflowException,
IllegalArgumentException,
IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionIORuntimeExceptionboolean compareAndSwapLong(long offset,
long expected,
long value)
throws BufferOverflowException,
IllegalArgumentException,
IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionIORuntimeExceptiondefault boolean compareAndSwapFloat(long offset,
float expected,
float value)
throws BufferOverflowException,
IllegalArgumentException,
IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionIORuntimeExceptiondefault boolean compareAndSwapDouble(long offset,
double expected,
double value)
throws BufferOverflowException,
IllegalArgumentException,
IORuntimeException
offset - to perform CASexpected - valuevalue - to setBufferOverflowExceptionIllegalArgumentExceptionIORuntimeExceptionCopyright © 2015. All rights reserved.