public static class SubIO.Readable extends SubIO implements IO.Readable, IO.KnownSize
| Modifier and Type | Class and Description |
|---|---|
static class |
SubIO.Readable.Seekable
Sub-part of a Seekable Readable IO.
|
SubIO.ReadableIO.Readable.BufferedIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impl| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closeContainer |
protected String |
description |
protected IO.Readable |
io |
protected long |
pos |
protected long |
size |
| Constructor and Description |
|---|
Readable(IO.Readable src,
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.
|
protected void |
closeResources(SynchronizationPoint<Exception> ondone) |
protected ISynchronizationPoint<?> |
closeUnderlyingResources() |
byte |
getPriority()
Return the priority.
|
AsyncWork<Long,IOException> |
getSizeAsync()
Asynchronous operation to get the size of the IO.
|
long |
getSizeSync()
Synchronous operation to get the size of the IO.
|
String |
getSourceDescription()
Describe the IO, which can be used for logging or debugging purposes.
|
TaskManager |
getTaskManager()
Return the TaskManager used for asynchronous operations.
|
IO |
getWrappedIO()
If this IO is wrapping another one (such as adding Buffered capabilities), this method returns it,
or null if it does not wrap another IO.
|
AsyncWork<Integer,IOException> |
readAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Asynchronous read operation.
|
AsyncWork<Integer,IOException> |
readFullyAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Asynchronous read operation to fully fill the given buffer.
|
int |
readFullySync(ByteBuffer buffer)
Synchronous read operation to fully fill the given buffer.
|
int |
readSync(ByteBuffer buffer)
Read synchronously into the given buffer.
|
void |
setPriority(byte priority)
Set the priority of asynchronous operations.
|
AsyncWork<Long,IOException> |
skipAsync(long n,
RunnableWithParameter<Pair<Long,IOException>> ondone)
Returns the number of bytes skipped.
|
long |
skipSync(long n)
Returns the number of bytes skipped.
|
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsync, readFullyAsync, skipAsynclockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerprotected IO.Readable io
protected long pos
protected long size
protected String description
protected boolean closeContainer
public Readable(IO.Readable src, long size, String description, boolean closeSrcOnClose)
public IO getWrappedIO()
IOgetWrappedIO in interface IOpublic String getSourceDescription()
IOgetSourceDescription in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOpublic byte getPriority()
ConcurrentCloseablegetPriority in interface IOgetPriority in class ConcurrentCloseablepublic void setPriority(byte priority)
IOsetPriority in interface IOprotected ISynchronizationPoint<?> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseableprotected void closeResources(SynchronizationPoint<Exception> ondone)
closeResources in class ConcurrentCloseablepublic ISynchronizationPoint<IOException> canStartReading()
IO.ReadablecanStartReading in interface IO.Readablepublic long getSizeSync()
IO.KnownSizegetSizeSync in interface IO.KnownSizepublic AsyncWork<Long,IOException> getSizeAsync()
IO.KnownSizegetSizeAsync in interface IO.KnownSizepublic int readSync(ByteBuffer buffer) throws IOException
IO.ReadablereadSync in interface IO.Readablebuffer - buffer to fillIOExceptionpublic AsyncWork<Integer,IOException> readAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.ReadablereadAsync in interface IO.Readablebuffer - buffer to fillondone - called before the returned AsyncWork is unblocked and its listeners are called.public int readFullySync(ByteBuffer buffer) throws IOException
IO.ReadablereadFullySync in interface IO.Readablebuffer - the buffer to fillIOExceptionpublic AsyncWork<Integer,IOException> readFullyAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.ReadablereadFullyAsync in interface IO.Readablebuffer - the buffer to fillondone - called before the returned AsyncWork is unblocked and its listeners are called.public long skipSync(long n)
throws IOException
IO.ReadableskipSync in interface IO.ReadableIOExceptionpublic AsyncWork<Long,IOException> skipAsync(long n, RunnableWithParameter<Pair<Long,IOException>> ondone)
IO.ReadableskipAsync in interface IO.ReadableCopyright © 2017. All rights reserved.