public static class FileIO.WriteOnly extends FileIO implements IO.Writable.Seekable, IO.Resizable
FileIO.ReadOnly, FileIO.ReadWrite, FileIO.WriteOnlyIO.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.Impl| Constructor and Description |
|---|
WriteOnly(File file,
byte priority)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IAsync<IOException> |
canStartWriting()
Return a synchronization point that is unblocked when data is ready to be written.
|
long |
getPosition()
Return the current position.
|
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.
|
AsyncSupplier<Void,IOException> |
setSizeAsync(long size)
Asynchronous resize.
|
void |
setSizeSync(long size)
Synchronous resize.
|
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. |
canStart, closeResources, closeUnderlyingResources, getFile, getPriority, getSizeAsync, getSizeSync, getSourceDescription, getTaskManager, getWrappedIO, readAsync, readAsync, readFullyAsync, readFullyAsync, readFullySync, readFullySync, readSync, readSync, setPriority, skipAsync, skipSyncaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteAsyncwriteAsyncseekAsynccancelClosed, error, errorCancelled, getPriority, getSourceDescription, getTaskManager, getWrappedIO, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenergetSizeAsync, getSizeSyncpublic WriteOnly(File file, byte priority)
public IAsync<IOException> canStartWriting()
IO.WritablecanStartWriting in interface IO.Writablepublic long getPosition()
IO.PositionKnowngetPosition in interface IO.PositionKnowngetPosition in class FileIOpublic void setSizeSync(long size)
throws IOException
IO.ResizablesetSizeSync in interface IO.ResizablesetSizeSync in class FileIOIOExceptionpublic AsyncSupplier<Void,IOException> setSizeAsync(long size)
IO.ResizablesetSizeAsync in interface IO.ResizablesetSizeAsync in class FileIOpublic long seekSync(IO.Seekable.SeekType type, long move) throws IOException
IO.SeekableseekSync in interface IO.SeekableseekSync in class FileIOIOExceptionpublic AsyncSupplier<Long,IOException> seekAsync(IO.Seekable.SeekType type, long move, Consumer<Pair<Long,IOException>> ondone)
IO.SeekableseekAsync in interface IO.SeekableseekAsync in class FileIOpublic int writeSync(ByteBuffer buffer) throws IOException
IO.WritablewriteSync in interface IO.WritablewriteSync in class FileIOIOExceptionpublic 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 FileIOIOExceptionpublic AsyncSupplier<Integer,IOException> writeAsync(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.WritablewriteAsync in interface IO.WritablewriteAsync in class FileIOpublic 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 FileIOCopyright © 2019. All rights reserved.