public static interface IO.Readable.Buffered extends IO.Readable, IO.ReadableByteStream
IO.Readable.Buffered, IO.Readable.SeekableIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impl| Modifier and Type | Method and Description |
|---|---|
int |
readAsync()
Read a single byte if possible.
|
default AsyncSupplier<Integer,IOException> |
readFullySyncIfPossible(ByteBuffer buffer)
While readAsync methods are supposed to do the job in a separate thread, this method
fills the given buffer synchronously if enough data is already buffered, else it finishes asynchronously.
|
AsyncSupplier<Integer,IOException> |
readFullySyncIfPossible(ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
While readAsync methods are supposed to do the job in a separate thread, this method
fills the given buffer synchronously if enough data is already buffered, else it finishes asynchronously.
|
ByteBuffer |
readNextBuffer()
Retrieve a buffer of bytes in the most efficient way depending on the implementation of Buffered.
Its returns the immediately available bytes with a minimum of operations. |
default AsyncSupplier<ByteBuffer,IOException> |
readNextBufferAsync()
Equivalent to readNextBufferAsync(null).
|
AsyncSupplier<ByteBuffer,IOException> |
readNextBufferAsync(Consumer<Pair<ByteBuffer,IOException>> ondone)
Retrieve a buffer of bytes in the most efficient way depending on the implementation of Buffered.
This method is similar to readAsync, it reads some bytes that are immediately available with a minimum of operations. |
canStartReading, readAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readSync, skipAsync, skipAsync, skipSynccanStartReading, read, read, readByte, readFully, skipcancelClosed, error, errorCancelled, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerAsyncSupplier<ByteBuffer,IOException> readNextBufferAsync(Consumer<Pair<ByteBuffer,IOException>> ondone)
default AsyncSupplier<ByteBuffer,IOException> readNextBufferAsync()
ByteBuffer readNextBuffer() throws IOException
IOExceptionint readAsync()
throws IOException
IOExceptionAsyncSupplier<Integer,IOException> readFullySyncIfPossible(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
default AsyncSupplier<Integer,IOException> readFullySyncIfPossible(ByteBuffer buffer)
Copyright © 2019. All rights reserved.