public abstract class FragmentedSubIO extends ConcurrentCloseable implements IO.KnownSize, IO.Seekable
| Modifier and Type | Class and Description |
|---|---|
static class |
FragmentedSubIO.Readable
Readable fragmented IO.
|
IO.Seekable.SeekTypeIO.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 boolean |
closeParentIOOnClose |
protected String |
description |
protected List<RangeLong> |
fragments |
protected IO.Seekable |
io |
protected long |
pos |
protected long |
size |
| Constructor and Description |
|---|
FragmentedSubIO(IO.Seekable io,
List<RangeLong> fragments,
boolean closeParentIOOnClose,
String description)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeResources(SynchronizationPoint<Exception> ondone) |
protected ISynchronizationPoint<?> |
closeUnderlyingResources() |
long |
getPosition()
Return the current position.
|
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.
|
protected AsyncWork<Integer,IOException> |
readAsync(long pos,
ByteBuffer buffer,
RunnableWithParameter<Pair<Integer,IOException>> ondone) |
protected int |
readFullySync(long pos,
ByteBuffer buffer) |
protected int |
readSync(long pos,
ByteBuffer buffer) |
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.
|
void |
setPriority(byte priority)
Set the priority of asynchronous operations.
|
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, waitseekAsynclockClose, unlockCloseclosecloseAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerprotected IO.Seekable io
protected long pos
protected long size
protected boolean closeParentIOOnClose
protected String description
public FragmentedSubIO(IO.Seekable io, List<RangeLong> fragments, boolean closeParentIOOnClose, String description)
protected ISynchronizationPoint<?> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseableprotected void closeResources(SynchronizationPoint<Exception> ondone)
closeResources in class ConcurrentCloseablepublic IO getWrappedIO()
IOgetWrappedIO 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 IOpublic String getSourceDescription()
IOgetSourceDescription in interface IOpublic long getPosition()
IO.PositionKnowngetPosition in interface IO.PositionKnownpublic long getSizeSync()
IO.KnownSizegetSizeSync in interface IO.KnownSizepublic AsyncWork<Long,IOException> getSizeAsync()
IO.KnownSizegetSizeAsync in interface IO.KnownSizeprotected AsyncWork<Integer,IOException> readAsync(long pos, ByteBuffer buffer, RunnableWithParameter<Pair<Integer,IOException>> ondone)
protected int readSync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionprotected int readFullySync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionpublic long seekSync(IO.Seekable.SeekType type, long move)
IO.SeekableseekSync in interface IO.Seekableprotected long skipSync(long n)
public AsyncWork<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, RunnableWithParameter<Pair<Long,IOException>> ondone)
IO.SeekableseekAsync in interface IO.Seekableprotected AsyncWork<Long,IOException> skipAsync(long n, RunnableWithParameter<Pair<Long,IOException>> ondone)
Copyright © 2017. All rights reserved.