public static class LinkedIO.Readable.Seekable.Buffered extends LinkedIO.Readable.Seekable implements IO.Readable.Buffered
| Modifier and Type | Class and Description |
|---|---|
static class |
LinkedIO.Readable.Seekable.Buffered.DeterminedSize
Add the DeterminedSize capability.
|
LinkedIO.Readable.Seekable.BufferedLinkedIO.Readable.SeekableLinkedIO.Readable, LinkedIO.ReadWriteIO.Readable.Buffered, IO.Readable.SeekableIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.ImplIO.Seekable.SeekType| Constructor and Description |
|---|
Buffered(String description,
IO.Readable.Seekable... ios)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
read()
Read next byte.
|
int |
read(byte[] buf,
int off,
int len)
Read bytes into the given buffer, starting to store them at the given offset, and with the given maximum number of bytes.
|
int |
readAsync()
Read a single byte if possible.
|
int |
readFully(byte[] buffer)
Read bytes to fill the given buffer, and return the number of bytes read which is less than the
size of the buffer only if the end of the IO is reached, and so may return 0.
|
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. |
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. |
int |
skip(int n)
Same as
IO.Readable.skipSync(long) but limited to an integer. |
getPosition, nextIOAsync, nextIOSync, previousIOAsync, previousIOSync, readAsync, readFullyAsync, readFullySync, readSync, seekAsync, seekSynccanStartReading, readAsync, readFullyAsync, readFullySync, readSync, skipAsync, skipSynccanStartWriting, closeResources, closeUnderlyingResources, getPriority, getSizeAsync, getSizeSync, getSourceDescription, getTaskManager, getWrappedIO, nextIOAsyncSeekable, nextIOAsyncStream, nextIOSyncSeekable, nextIOSyncStream, previousIOAsyncSeekable, previousIOAsyncStream, previousIOSyncSeekable, previousIOSyncStream, setPriority, writeAsync, writeAsync, writeSync, writeSyncaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadFullySyncIfPossible, readNextBufferAsynccanStartReading, readAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readSync, skipAsync, skipAsync, skipSynccanStartReading, readBytecancelClosed, error, errorCancelled, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerreadAsync, readFullyAsyncseekAsyncpublic Buffered(String description, IO.Readable.Seekable... ios)
public int read()
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamread in class LinkedIOIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamread in class LinkedIOIOExceptionpublic int readFully(byte[] buffer)
throws IOException
IO.ReadableByteStreamreadFully in interface IO.ReadableByteStreamreadFully in class LinkedIOIOExceptionpublic AsyncSupplier<Integer,IOException> readFullySyncIfPossible(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.Readable.BufferedreadFullySyncIfPossible in interface IO.Readable.BufferedreadFullySyncIfPossible in class LinkedIOpublic int readAsync()
throws IOException
IO.Readable.BufferedreadAsync in interface IO.Readable.BufferedreadAsync in class LinkedIOIOExceptionpublic int skip(int n)
throws IOException
IO.ReadableByteStreamIO.Readable.skipSync(long) but limited to an integer.skip in interface IO.ReadableByteStreamskip in class LinkedIOIOExceptionpublic AsyncSupplier<ByteBuffer,IOException> readNextBufferAsync(Consumer<Pair<ByteBuffer,IOException>> ondone)
IO.Readable.BufferedreadNextBufferAsync in interface IO.Readable.BufferedreadNextBufferAsync in class LinkedIOpublic ByteBuffer readNextBuffer() throws IOException
IO.Readable.BufferedreadNextBuffer in interface IO.Readable.BufferedreadNextBuffer in class LinkedIOIOExceptionCopyright © 2019. All rights reserved.