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 Buffer
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public 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
.