public final class ContentWriters
extends java.lang.Object
Some of these writers are by default registered on the response.
| Modifier and Type | Method | Description |
|---|---|---|
static java.util.function.Function<byte[],io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> |
byteArrayWriter(boolean copy) |
Returns a writer function for
byte[]. |
static java.util.function.Function<java.nio.channels.ReadableByteChannel,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> |
byteChannelWriter() |
Returns a writer function for
ReadableByteChannel. |
static java.util.function.Function<java.nio.channels.ReadableByteChannel,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> |
byteChannelWriter(io.helidon.common.reactive.RetrySchema retrySchema) |
Returns a writer function for
ReadableByteChannel. |
static java.util.function.Function<java.lang.CharSequence,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> |
charSequenceWriter(java.nio.charset.Charset charset) |
Returns a writer function for
CharSequence using provided standard charset. |
public static java.util.function.Function<byte[],io.helidon.common.reactive.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 java.util.function.Function<java.lang.CharSequence,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> charSequenceWriter(java.nio.charset.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 writerjava.lang.NullPointerException - if parameter charset is nullpublic static java.util.function.Function<java.nio.channels.ReadableByteChannel,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> byteChannelWriter(io.helidon.common.reactive.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 java.util.function.Function<java.nio.channels.ReadableByteChannel,io.helidon.common.reactive.Flow.Publisher<ResponseChunk>> byteChannelWriter()
ReadableByteChannel.ReadableByteChannel writerCopyright © 2018 Oracle Corporation. All rights reserved.