public static class PositionKnownWrapper.Readable extends PositionKnownWrapper<IO.Readable> implements IO.Readable, IO.PositionKnown
| Modifier and Type | Class and Description |
|---|---|
static class |
PositionKnownWrapper.Readable.Buffered
Add the capability to known on which position we are on a Buffered Readable.
|
PositionKnownWrapper.ReadableIO.Readable.SeekableIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Implio, position| Constructor and Description |
|---|
Readable(IO.Readable io)
Constructor.
|
Readable(IO.Readable io,
long position)
Constructor with initial position.
|
| Modifier and Type | Method and Description |
|---|---|
IAsync<IOException> |
canStartReading()
Return a synchronization point that is unblocked when data is ready to be read.
|
AsyncSupplier<Integer,IOException> |
readAsync(ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Asynchronous read operation.
|
AsyncSupplier<Integer,IOException> |
readFullyAsync(ByteBuffer buffer,
Consumer<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.
|
AsyncSupplier<Long,IOException> |
skipAsync(long n,
Consumer<Pair<Long,IOException>> ondone)
Returns the number of bytes skipped.
|
long |
skipSync(long n)
Returns the number of bytes skipped.
|
addPositionChangedListener, addPositionChangedListener, closeResources, closeUnderlyingResources, getPosition, getPriority, getSourceDescription, getTaskManager, getWrappedIO, read, read, readAsync, readFully, readFullySyncIfPossible, readNextBuffer, readNextBufferAsync, removePositionChangedListener, removePositionChangedListener, setPriority, skipaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsync, readFullyAsync, skipAsyncgetPositioncancelClosed, error, errorCancelled, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic Readable(IO.Readable io, long position)
public Readable(IO.Readable io)
public IAsync<IOException> canStartReading()
IO.ReadablecanStartReading in interface IO.ReadablecanStartReading in class PositionKnownWrapper<IO.Readable>public int readSync(ByteBuffer buffer) throws IOException
IO.ReadablereadSync in interface IO.ReadablereadSync in class PositionKnownWrapper<IO.Readable>buffer - buffer to fillIOExceptionpublic AsyncSupplier<Integer,IOException> readAsync(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.ReadablereadAsync in interface IO.ReadablereadAsync in class PositionKnownWrapper<IO.Readable>buffer - 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.ReadablereadFullySync in class PositionKnownWrapper<IO.Readable>buffer - the buffer to fillIOExceptionpublic AsyncSupplier<Integer,IOException> readFullyAsync(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.ReadablereadFullyAsync in interface IO.ReadablereadFullyAsync in class PositionKnownWrapper<IO.Readable>buffer - 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.ReadableskipSync in class PositionKnownWrapper<IO.Readable>IOExceptionpublic AsyncSupplier<Long,IOException> skipAsync(long n, Consumer<Pair<Long,IOException>> ondone)
IO.ReadableskipAsync in interface IO.ReadableskipAsync in class PositionKnownWrapper<IO.Readable>Copyright © 2019. All rights reserved.