public static class SubIO.Readable.Seekable.Buffered extends SubIO.Readable.Seekable implements IO.Readable.Buffered
SubIO.Readable.Seekable.BufferedSubIO.Readable.SeekableSubIO.ReadableIO.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.SeekTypestartcloseContainer, description, io, pos, size| Constructor and Description |
|---|
Buffered(T src,
long start,
long size,
String description,
boolean closeSrcOnClose)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ISynchronizationPoint<IOException> |
canStartReading()
Return a synchronization point that is unblocked when data is ready to be read.
|
int |
read()
Read next byte.
|
int |
read(byte[] buffer,
int offset,
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.
|
AsyncWork<ByteBuffer,IOException> |
readNextBufferAsync(RunnableWithParameter<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 read some bytes that are immediately available with a minimum of operations. |
int |
skip(int skip)
Same as
IO.Readable.skipSync(long) but limited to an integer. |
getPosition, readAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readFullySync, readSync, readSync, seekAsync, seekSync, skipAsync, skipSynccloseResources, closeUnderlyingResources, getPriority, getSizeAsync, getSizeSync, getSourceDescription, getTaskManager, getWrappedIO, setPriorityaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadNextBufferAsyncreadAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readSync, skipAsync, skipAsync, skipSyncreadByteerror, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerreadAsync, readFullyAsyncseekAsyncpublic Buffered(T src,
long start,
long size,
String description,
boolean closeSrcOnClose)
public ISynchronizationPoint<IOException> canStartReading()
IO.ReadablecanStartReading in interface IO.ReadablecanStartReading in interface IO.ReadableByteStreamcanStartReading in class SubIO.Readablepublic int read()
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int len)
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamIOExceptionpublic int readFully(byte[] buffer)
throws IOException
IO.ReadableByteStreamreadFully in interface IO.ReadableByteStreamIOExceptionpublic int readAsync()
throws IOException
IO.Readable.BufferedreadAsync in interface IO.Readable.BufferedIOExceptionpublic int skip(int skip)
IO.ReadableByteStreamIO.Readable.skipSync(long) but limited to an integer.skip in interface IO.ReadableByteStreampublic AsyncWork<ByteBuffer,IOException> readNextBufferAsync(RunnableWithParameter<Pair<ByteBuffer,IOException>> ondone)
IO.Readable.BufferedreadNextBufferAsync in interface IO.Readable.BufferedCopyright © 2017. All rights reserved.