java.lang.Object
io.helidon.media.common.ContentReaders
Utility class that provides standalone mechanisms for reading message body
content.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reader<byte[]>
Deprecated.static Reader<InputStream>
Deprecated.since 2.0.0, useDefaultMediaSupport.inputStreamReader()
static Single<byte[]>
readBytes
(Flow.Publisher<DataChunk> chunks) Collect theDataChunk
of the given publisher into a single byte array.readString
(Flow.Publisher<DataChunk> chunks, Charset charset) readURLEncodedString
(Flow.Publisher<DataChunk> chunks, Charset charset) stringReader
(Charset charset) Deprecated.since 2.0.0, usereadString(Publisher, Charset)
} orDefaultMediaSupport.stringReader()
insteadurlEncodedStringReader
(Charset charset) Deprecated.since 2.0.0, usereadURLEncodedString(Publisher, Charset)
instead
-
Method Details
-
readBytes
Collect theDataChunk
of the given publisher into a single byte array.- Parameters:
chunks
- source publisher- Returns:
- Single
- Since:
- 2.0.0
-
readString
- Parameters:
chunks
- source publishercharset
- charset to use for decoding the bytes- Returns:
- Single
-
readURLEncodedString
public static Single<String> readURLEncodedString(Flow.Publisher<DataChunk> chunks, Charset charset) - Parameters:
chunks
- source publishercharset
- charset to use for decoding the input- Returns:
- Single
- Since:
- 2.0.0
-
stringReader
Deprecated.since 2.0.0, usereadString(Publisher, Charset)
} orDefaultMediaSupport.stringReader()
instead- Parameters:
charset
- the charset to use with the returned string content reader- Returns:
- a string content reader
-
urlEncodedStringReader
Deprecated.since 2.0.0, usereadURLEncodedString(Publisher, Charset)
instead- Parameters:
charset
- the charset to use with the returned string content reader- Returns:
- the URL-decoded string content reader
-
byteArrayReader
Deprecated.since 2.0.0, usereadBytes(Publisher)
insteadGet a reader that converts aDataChunk
publisher to an array of bytes.- Returns:
- reader that transforms a publisher of byte buffers to a completion stage that might end exceptionally with
-
inputStreamReader
Deprecated.since 2.0.0, useDefaultMediaSupport.inputStreamReader()
Get a reader that converts aDataChunk
publisher to a blocking JavaInputStream
. The resultingCompletionStage
is already completed; however, the referencedInputStream
in it may not already have all the data available; in such case, the read method (e.g.,InputStream.read()
) block.- Returns:
- a input stream content reader
-
readBytes(Publisher)
instead