public class IOFromOutputStream extends AbstractIO implements IO.Writable
IO.Writable.Buffered, IO.Writable.SeekableIO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impldescription, priority| Constructor and Description |
|---|
IOFromOutputStream(OutputStream stream,
String sourceDescription,
TaskManager manager,
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.
|
protected void |
closeResources(Async<IOException> ondone) |
protected IAsync<IOException> |
closeUnderlyingResources() |
OutputStream |
getOutputStream() |
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.
|
AsyncSupplier<Integer,IOException> |
writeAsync(ByteBuffer buffer,
Consumer<Pair<Integer,IOException>> ondone)
Write asynchronously all bytes available in the given buffer at the current position.
|
int |
writeSync(ByteBuffer buffer)
Write synchronously all bytes available in the given buffer at the current position.
|
getPriority, getSourceDescription, setPriorityaddCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteAsynccancelClosed, error, errorCancelled, getPriority, getSourceDescription, setPrioritylockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic IOFromOutputStream(OutputStream stream, String sourceDescription, TaskManager manager, byte priority)
public OutputStream getOutputStream()
public IO getWrappedIO()
IOgetWrappedIO in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOpublic IAsync<IOException> canStartWriting()
IO.WritablecanStartWriting in interface IO.Writablepublic int writeSync(ByteBuffer buffer) throws IOException
IO.WritablewriteSync in interface IO.WritableIOExceptionpublic AsyncSupplier<Integer,IOException> writeAsync(ByteBuffer buffer, Consumer<Pair<Integer,IOException>> ondone)
IO.WritablewriteAsync in interface IO.Writableprotected IAsync<IOException> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseable<IOException>protected void closeResources(Async<IOException> ondone)
closeResources in class ConcurrentCloseable<IOException>Copyright © 2019. All rights reserved.