IOType - type of IOpublic abstract class PositionKnownWrapper<IOType extends IO> extends ConcurrentCloseable implements IO.PositionKnown
| Modifier and Type | Class and Description |
|---|---|
static class |
PositionKnownWrapper.Readable
Add the capability to known on which position we are on a Readable.
|
IO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.ReadableByteStream, IO.Resizable, IO.Seekable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impl| Modifier and Type | Field and Description |
|---|---|
protected IOType |
io |
protected long |
position |
| Constructor and Description |
|---|
PositionKnownWrapper(IOType io,
long position)
Constructor with initial position.
|
| Modifier and Type | Method and Description |
|---|---|
protected ISynchronizationPoint<IOException> |
canStartReading() |
protected void |
closeResources(SynchronizationPoint<Exception> ondone) |
protected ISynchronizationPoint<?> |
closeUnderlyingResources() |
long |
getPosition()
Return the current position.
|
byte |
getPriority()
Return the priority.
|
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.
|
protected int |
read() |
protected int |
read(byte[] buffer,
int offset,
int len) |
protected int |
readAsync() |
protected AsyncWork<Integer,IOException> |
readAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected int |
readFully(byte[] buffer) |
protected AsyncWork<Integer,IOException> |
readFullyAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected int |
readFullySync(ByteBuffer buffer) |
protected AsyncWork<ByteBuffer,IOException> |
readNextBufferAsync(RunnableWithParameter<Pair<ByteBuffer,IOException>> ondone) |
protected int |
readSync(ByteBuffer buffer) |
void |
setPriority(byte priority)
Set the priority of asynchronous operations.
|
protected int |
skip(int skip) |
protected AsyncWork<Long,IOException> |
skipAsync(long n,
RunnableWithParameter<Pair<Long,IOException>> ondone) |
protected long |
skipSync(long n) |
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic PositionKnownWrapper(IOType io, long position)
public String getSourceDescription()
IOgetSourceDescription in interface IOpublic IO getWrappedIO()
IOgetWrappedIO in interface IOpublic byte getPriority()
ConcurrentCloseablegetPriority in interface IOgetPriority in class ConcurrentCloseablepublic void setPriority(byte priority)
IOsetPriority in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOpublic long getPosition()
IO.PositionKnowngetPosition in interface IO.PositionKnownprotected ISynchronizationPoint<?> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseableprotected void closeResources(SynchronizationPoint<Exception> ondone)
closeResources in class ConcurrentCloseableprotected ISynchronizationPoint<IOException> canStartReading()
protected int readSync(ByteBuffer buffer) throws IOException
IOExceptionprotected int readAsync()
throws IOException
IOExceptionprotected AsyncWork<Integer,IOException> readAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected int readFullySync(ByteBuffer buffer) throws IOException
IOExceptionprotected AsyncWork<Integer,IOException> readFullyAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected long skipSync(long n)
throws IOException
IOExceptionprotected AsyncWork<Long,IOException> skipAsync(long n, RunnableWithParameter<Pair<Long,IOException>> ondone)
protected int read()
throws IOException
IOExceptionprotected int read(byte[] buffer,
int offset,
int len)
throws IOException
IOExceptionprotected int readFully(byte[] buffer)
throws IOException
IOExceptionprotected int skip(int skip)
throws IOException
IOExceptionprotected AsyncWork<ByteBuffer,IOException> readNextBufferAsync(RunnableWithParameter<Pair<ByteBuffer,IOException>> ondone)
Copyright © 2017. All rights reserved.