public final class ConnectableBufferOutputStream
extends java.io.OutputStream
OutputStream that can be connected to a sink such that any data written on the OutputStream is
eventually emitted to the connected Publisher PublisherSource.Subscriber.| Constructor and Description |
|---|
ConnectableBufferOutputStream(BufferAllocator allocator)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Publisher<Buffer> |
connect()
Connects this
OutputStream to the returned Publisher such that any data written to this
OutputStream is eventually delivered to a PublisherSource.Subscriber of the returned Publisher. |
void |
flush() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public ConnectableBufferOutputStream(BufferAllocator allocator)
allocator - BufferAllocator to convert {code byte[]} to Bufferpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic Publisher<Buffer> connect()
OutputStream to the returned Publisher such that any data written to this
OutputStream is eventually delivered to a PublisherSource.Subscriber of the returned Publisher.Publisher that will emit all data written to this OutputStream to its PublisherSource.Subscriber.
Only a single active PublisherSource.Subscriber is allowed for this Publisher.