public class OutputStreamPublisher extends OutputStream implements Flow.Publisher<ByteBuffer>
publishes any data written to it as ByteBuffer
events.| Constructor and Description |
|---|
OutputStreamPublisher() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
subscribe(Flow.Subscriber<? super ByteBuffer> subscriberParam)
Adds the given Subscriber if possible.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flushpublic void subscribe(Flow.Subscriber<? super ByteBuffer> subscriberParam)
Flow.PublisheronError
method is invoked with an IllegalStateException.
Otherwise, the Subscriber's onSubscribe method is
invoked with a new Flow.Subscription. Subscribers may
enable receiving items by invoking the request
method of this Subscription, and may unsubscribe by
invoking its cancel method.subscribe in interface Flow.Publisher<ByteBuffer>subscriberParam - the subscriberpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2018–2019 Oracle Corporation. All rights reserved.