public final class ContentWriters extends Object
Some of these writers are by default registered on the response.
| Modifier and Type | Method | Description |
|---|---|---|
static Function<byte[],Flow.Publisher<ResponseChunk>> |
byteArrayWriter(boolean copy) |
Returns a writer function for
byte[]. |
static Function<ReadableByteChannel,Flow.Publisher<ResponseChunk>> |
byteChannelWriter() |
Returns a writer function for
ReadableByteChannel. |
static Function<ReadableByteChannel,Flow.Publisher<ResponseChunk>> |
byteChannelWriter(RetrySchema retrySchema) |
Returns a writer function for
ReadableByteChannel. |
static Function<CharSequence,Flow.Publisher<ResponseChunk>> |
charSequenceWriter(Charset charset) |
Returns a writer function for
CharSequence using provided standard charset. |
public static Function<byte[],Flow.Publisher<ResponseChunk>> byteArrayWriter(boolean copy)
byte[].
The copy variant is by default registered in ServerResponse.
copy - a signal if byte array should be copied - set it true if byte[] will be immediately reused.byte[] writerpublic static Function<CharSequence,Flow.Publisher<ResponseChunk>> charSequenceWriter(Charset charset)
CharSequence using provided standard charset.
An instance is by default registered in ServerResponse for all standard charsets.
charset - a standard charset to useString writerNullPointerException - if parameter charset is nullpublic static Function<ReadableByteChannel,Flow.Publisher<ResponseChunk>> byteChannelWriter(RetrySchema retrySchema)
ReadableByteChannel. Created publisher use provided RetrySchema to define
delay between unsuccessful read attempts.retrySchema - a retry schema to use in case when read operation reads 0 bytesReadableByteChannel writerpublic static Function<ReadableByteChannel,Flow.Publisher<ResponseChunk>> byteChannelWriter()
ReadableByteChannel.ReadableByteChannel writerCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.