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 TypeMethodDescriptionvoidclose()connect()Connects thisOutputStreamto the returnedPublishersuch that any data written to thisOutputStreamis eventually delivered to aPublisherSource.Subscriberof the returnedPublisher.voidflush()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ConnectableBufferOutputStream
Creates a new instance.- Parameters:
allocator-BufferAllocatorto convert {code byte[]} toBuffer
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
connect
Connects thisOutputStreamto the returnedPublishersuch that any data written to thisOutputStreamis eventually delivered to aPublisherSource.Subscriberof the returnedPublisher.- Returns:
Publisherthat will emit all data written to thisOutputStreamto itsPublisherSource.Subscriber. Only a single activePublisherSource.Subscriberis allowed for thisPublisher.
-