Class ConnectableBufferOutputStream
java.lang.Object
java.io.OutputStream
io.servicetalk.concurrent.api.internal.ConnectableBufferOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An
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 Summary
ConstructorsConstructorDescriptionConnectableBufferOutputStream
(BufferAllocator allocator) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
connect()
Connects thisOutputStream
to the returnedPublisher
such that any data written to thisOutputStream
is eventually delivered to aPublisherSource.Subscriber
of the returnedPublisher
.void
flush()
void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ConnectableBufferOutputStream
Creates a new instance.- Parameters:
allocator
-BufferAllocator
to convert {code byte[]} toBuffer
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
connect
Connects thisOutputStream
to the returnedPublisher
such that any data written to thisOutputStream
is eventually delivered to aPublisherSource.Subscriber
of the returnedPublisher
.- Returns:
Publisher
that will emit all data written to thisOutputStream
to itsPublisherSource.Subscriber
. Only a single activePublisherSource.Subscriber
is allowed for thisPublisher
.
-