public abstract class FragmentedSubIO extends ConcurrentCloseable<IOException> implements IO.KnownSize, IO.Seekable
| Modifier and Type | Class and Description |
|---|---|
static class |
FragmentedSubIO.Readable
Readable fragmented IO.
|
static class |
FragmentedSubIO.ReadWrite
Readable and Writable 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 IAsync<IOException> |
canStartWriting() |
protected void |
closeResources(Async<IOException> ondone) |
protected IAsync<IOException> |
closeUnderlyingResources() |
long |
getPosition()
Return the current position.
|
byte |
getPriority()
Return the priority.
|
AsyncSupplier<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 AsyncSupplier<Integer,IOException> |
readAsync(long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone) |
protected int |
readFullySync(long pos,
ByteBuffer buffer) |
protected int |
readSync(long pos,
ByteBuffer buffer) |
AsyncSupplier<Long,IOException> |
seekAsync(IO.Seekable.SeekType type,
long move,
Consumer<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 AsyncSupplier<Long,IOException> |
skipAsync(long n,
Consumer<Pair<Long,IOException>> ondone) |
protected long |
skipSync(long n) |
protected void |
writeAsync(Iterator<RangeLong> it,
RangeLong r,
long p,
int done,
long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone,
AsyncSupplier<Integer,IOException> sp) |
protected AsyncSupplier<Integer,IOException> |
writeAsync(long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone) |
protected int |
writeSync(long pos,
ByteBuffer buffer) |
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitseekAsynccancelClosed, error, errorCancelledlockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, 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 IAsync<IOException> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseable<IOException>protected void closeResources(Async<IOException> ondone)
closeResources in class ConcurrentCloseable<IOException>public IO getWrappedIO()
IOgetWrappedIO in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOpublic byte getPriority()
ConcurrentCloseablegetPriority in interface IOgetPriority in class ConcurrentCloseable<IOException>public 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 AsyncSupplier<Long,IOException> getSizeAsync()
IO.KnownSizegetSizeAsync in interface IO.KnownSizeprotected AsyncSupplier<Integer,IOException> readAsync(long pos, ByteBuffer buffer, Consumer<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 AsyncSupplier<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, Consumer<Pair<Long,IOException>> ondone)
IO.SeekableseekAsync in interface IO.Seekableprotected AsyncSupplier<Long,IOException> skipAsync(long n, Consumer<Pair<Long,IOException>> ondone)
protected IAsync<IOException> canStartWriting()
protected int writeSync(long pos,
ByteBuffer buffer)
throws IOException
IOExceptionprotected AsyncSupplier<Integer,IOException> writeAsync(long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
protected void writeAsync(Iterator<RangeLong> it, RangeLong r, long p, int done, long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone, AsyncSupplier<Integer,IOException> sp)
Copyright © 2019. All rights reserved.