public static class SubIO.Readable.Seekable extends SubIO.Readable implements IO.Readable.Seekable
| Modifier and Type | Class and Description |
|---|---|
static class |
SubIO.Readable.Seekable.Buffered
Sub-part of a Buffered Seekable Readable IO.
|
SubIO.Readable.SeekableSubIO.ReadableIO.Readable.SeekableIO.Seekable.SeekTypeIO.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 long |
start |
closeContainer, description, io, pos, size| Constructor and Description |
|---|
Seekable(IO.Readable.Seekable src,
long start,
long size,
String description,
boolean closeSrcOnClose)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getPosition()
Return the current position.
|
AsyncWork<Integer,IOException> |
readAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Asynchronous read operation.
|
AsyncWork<Integer,IOException> |
readAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Same as
IO.Readable.readAsync(ByteBuffer, RunnableWithParameter) but read at the given position. |
AsyncWork<Integer,IOException> |
readFullyAsync(ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Asynchronous read operation to fully fill the given buffer.
|
AsyncWork<Integer,IOException> |
readFullyAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone)
Same as
IO.Readable.readFullyAsync(ByteBuffer, RunnableWithParameter) but read at the given position. |
int |
readFullySync(ByteBuffer buffer)
Synchronous read operation to fully fill the given buffer.
|
int |
readFullySync(long pos,
ByteBuffer buffer)
Same as
IO.Readable.readFullySync(ByteBuffer) but read at the given position. |
int |
readSync(ByteBuffer buffer)
Read synchronously into the given buffer.
|
int |
readSync(long pos,
ByteBuffer buffer)
Same as
IO.Readable.readSync(ByteBuffer) but read at the given position. |
AsyncWork<Long,IOException> |
seekAsync(IO.Seekable.SeekType type,
long move,
RunnableWithParameter<Pair<Long,IOException>> ondone)
Returns the new position.
|
long |
seekSync(IO.Seekable.SeekType type,
long move)
Returns the new position.
|
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.
|
canStartReading, closeResources, 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, waitreadAsync, readFullyAsynccanStartReading, readAsync, readFullyAsync, skipAsyncseekAsyncerror, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic Seekable(IO.Readable.Seekable src, long start, long size, String description, boolean closeSrcOnClose)
public long getPosition()
IO.PositionKnowngetPosition in interface IO.PositionKnownpublic int readSync(long pos,
ByteBuffer buffer)
throws IOException
IO.Readable.SeekableIO.Readable.readSync(ByteBuffer) but read at the given position.
The current position is changed to the given position plus the number of bytes read.readSync in interface IO.Readable.SeekableIOExceptionpublic int readSync(ByteBuffer buffer) throws IOException
IO.ReadablereadSync in interface IO.ReadablereadSync in class SubIO.Readablebuffer - buffer to fillIOExceptionpublic AsyncWork<Integer,IOException> readAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.Readable.SeekableIO.Readable.readAsync(ByteBuffer, RunnableWithParameter) but read at the given position.
The current position is changed to the given position plus the number of bytes read upon completion.readAsync in interface IO.Readable.Seekablepublic AsyncWork<Integer,IOException> readAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.ReadablereadAsync in interface IO.ReadablereadAsync in class SubIO.Readablebuffer - buffer to fillondone - called before the returned AsyncWork is unblocked and its listeners are called.public int readFullySync(long pos,
ByteBuffer buffer)
throws IOException
IO.Readable.SeekableIO.Readable.readFullySync(ByteBuffer) but read at the given position.
The current position is changed to the given position plus the number of bytes read.readFullySync in interface IO.Readable.SeekableIOExceptionpublic int readFullySync(ByteBuffer buffer) throws IOException
IO.ReadablereadFullySync in interface IO.ReadablereadFullySync in class SubIO.Readablebuffer - the buffer to fillIOExceptionpublic AsyncWork<Integer,IOException> readFullyAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.Readable.SeekableIO.Readable.readFullyAsync(ByteBuffer, RunnableWithParameter) but read at the given position.
The current position is changed to the given position plus the number of bytes read upon completion.readFullyAsync in interface IO.Readable.Seekablepublic AsyncWork<Integer,IOException> readFullyAsync(ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
IO.ReadablereadFullyAsync in interface IO.ReadablereadFullyAsync in class SubIO.Readablebuffer - the buffer to fillondone - called before the returned AsyncWork is unblocked and its listeners are called.public long seekSync(IO.Seekable.SeekType type, long move)
IO.SeekableseekSync in interface IO.Seekablepublic AsyncWork<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, RunnableWithParameter<Pair<Long,IOException>> ondone)
IO.SeekableseekAsync in interface IO.Seekablepublic long skipSync(long n)
IO.ReadableskipSync in interface IO.ReadableskipSync in class SubIO.Readablepublic AsyncWork<Long,IOException> skipAsync(long n, RunnableWithParameter<Pair<Long,IOException>> ondone)
IO.ReadableskipAsync in interface IO.ReadableskipAsync in class SubIO.ReadableCopyright © 2017. All rights reserved.