public static class FragmentedSubIO.ReadWrite extends FragmentedSubIO.Readable implements IO.Writable.Seekable
FragmentedSubIO.Readable, FragmentedSubIO.ReadWriteIO.Writable.Buffered, IO.Writable.SeekableIO.Seekable.SeekTypeIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.ImplIO.Readable.Buffered, IO.Readable.SeekablecloseParentIOOnClose, description, fragments, io, pos, size| Constructor and Description |
|---|
ReadWrite(T io,
List<RangeLong> fragments,
boolean closeParentIOOnClose,
String description)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IAsync<IOException> |
canStartWriting()
Return a synchronization point that is unblocked when data is ready to be written.
|
AsyncSupplier<Integer,IOException> |
writeAsync(ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Write asynchronously all bytes available in the given buffer at the current position.
|
AsyncSupplier<Integer,IOException> |
writeAsync(long pos,
ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Same as
IO.Writable.writeAsync(ByteBuffer, Consumer) but at the given position. |
int |
writeSync(ByteBuffer buffer)
Write synchronously all bytes available in the given buffer at the current position.
|
int |
writeSync(long pos,
ByteBuffer buffer)
Same as
IO.Writable.writeSync(ByteBuffer) but at the given position. |
canStartReading, readAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readFullySync, readSync, readSync, skipAsync, skipSynccloseResources, closeUnderlyingResources, getPosition, getPriority, getSizeAsync, getSizeSync, getSourceDescription, getTaskManager, getWrappedIO, seekAsync, seekSync, setPriority, writeAsyncaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteAsyncwriteAsyncseekAsync, seekAsync, seekSyncgetPositioncancelClosed, error, errorCancelled, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerreadAsync, readFullyAsyncreadAsync, readFullyAsync, skipAsyncpublic IAsync<IOException> canStartWriting()
IO.WritablecanStartWriting in interface IO.WritablecanStartWriting in class FragmentedSubIOpublic int writeSync(long pos,
ByteBuffer buffer)
throws IOException
IO.Writable.SeekableIO.Writable.writeSync(ByteBuffer) but at the given position.
Note that if the IO implements Resizable, the behaviour is different when writing at
the end or beyond the end of the IO: if not resizable, it must throw an exception,
while a resizable IO should accept it except if the resize operation fails.writeSync in interface IO.Writable.SeekablewriteSync in class FragmentedSubIOIOExceptionpublic int writeSync(ByteBuffer buffer) throws IOException
IO.WritablewriteSync in interface IO.WritableIOExceptionpublic AsyncSupplier<Integer,IOException> writeAsync(long pos, ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.Writable.SeekableIO.Writable.writeAsync(ByteBuffer, Consumer) but at the given position.
Note that if the IO implements Resizable, the behaviour is different when writing at
the end or beyond the end of the IO: if not resizable, it must throw an exception,
while a resizable IO should accept it except if the resize operation fails.writeAsync in interface IO.Writable.SeekablewriteAsync in class FragmentedSubIOpublic AsyncSupplier<Integer,IOException> writeAsync(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.WritablewriteAsync in interface IO.WritableCopyright © 2019. All rights reserved.