- java.lang.Object
-
- java.io.OutputStream
-
- io.helidon.common.reactive.MultiFromOutputStream
-
- All Implemented Interfaces:
Multi<ByteBuffer>,Subscribable<ByteBuffer>,Closeable,Flushable,AutoCloseable,Flow.Publisher<ByteBuffer>
public class MultiFromOutputStream extends OutputStream implements Multi<ByteBuffer>
Output stream thatFlow.Publisherpublishes any data written to it asByteBufferevents.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMultiFromOutputStream()Create new output stream thatFlow.Publisherpublishes any data written to it asByteBufferevents.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()Send empty buffer as an indication of a user-requested flush.MultiFromOutputStreamonRequest(BiConsumer<Long,Long> requestCallback)Callback executed when request signal from downstream arrive.voidsubscribe(Flow.Subscriber<? super ByteBuffer> subscriber)voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.common.reactive.Multi
collect, collect, collectList, collectStream, compose, defaultIfEmpty, distinct, dropWhile, filter, first, flatMap, flatMap, flatMapIterable, flatMapIterable, forEach, limit, map, observeOn, observeOn, onCancel, onComplete, onCompleteResume, onCompleteResumeWith, onError, onErrorResume, onErrorResumeWith, onTerminate, peek, reduce, reduce, retry, retry, retryWhen, skip, switchIfEmpty, takeUntil, takeWhile, timeout, timeout, to
-
Methods inherited from interface io.helidon.common.reactive.Subscribable
subscribe, subscribe, subscribe, subscribe
-
-
-
-
Constructor Detail
-
MultiFromOutputStream
protected MultiFromOutputStream()
Create new output stream thatFlow.Publisherpublishes any data written to it asByteBufferevents.
-
-
Method Detail
-
onRequest
public MultiFromOutputStream onRequest(BiConsumer<Long,Long> requestCallback)
Callback executed when request signal from downstream arrive.- param
nthe requested count. - param
demandthe current total cumulative requested count, ranges between [0,Long.MAX_VALUE] where the max indicates that this publisher is unbounded.
- Parameters:
requestCallback- to be executed- Returns:
- this OutputStreamMulti
- param
-
subscribe
public void subscribe(Flow.Subscriber<? super ByteBuffer> subscriber)
- Specified by:
subscribein interfaceFlow.Publisher<ByteBuffer>
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOExceptionSend empty buffer as an indication of a user-requested flush.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException- If an I/O occurs.
-
-