Package io.micronaut.http.body
Class StringBodyReader
java.lang.Object
io.micronaut.http.body.StringBodyReader
- All Implemented Interfaces:
ChunkedMessageBodyReader<String>
,MessageBodyReader<String>
,TypedMessageBodyReader<String>
@Internal
@Singleton
public final class StringBodyReader
extends Object
implements TypedMessageBodyReader<String>, ChunkedMessageBodyReader<String>
The body reader for
String
.- Since:
- 4.6
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptiongetType()
Reads an object from the given byte buffer.Reads an object from the given byte buffer.readChunked
(Argument<String> type, MediaType mediaType, Headers httpHeaders, Publisher<ByteBuffer<?>> input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.body.TypedMessageBodyReader
isReadable
-
Method Details
-
getType
- Specified by:
getType
in interfaceTypedMessageBodyReader<String>
- Returns:
- The body type.
-
read
public String read(Argument<String> type, MediaType mediaType, Headers httpHeaders, ByteBuffer<?> byteBuffer) throws CodecException Description copied from interface:MessageBodyReader
Reads an object from the given byte buffer.- Specified by:
read
in interfaceMessageBodyReader<String>
- Parameters:
type
- The type being decoded.mediaType
- The media type, can benull
httpHeaders
- The HTTP headersbyteBuffer
- The byte buffer- Returns:
- The read object or
null
- Throws:
CodecException
- If an error occurs decoding
-
read
public String read(Argument<String> type, MediaType mediaType, Headers httpHeaders, InputStream inputStream) throws CodecException Description copied from interface:MessageBodyReader
Reads an object from the given byte buffer.- Specified by:
read
in interfaceMessageBodyReader<String>
- Parameters:
type
- The type being decoded.mediaType
- The media type, can benull
httpHeaders
- The HTTP headersinputStream
- The input stream- Returns:
- The read object or
null
- Throws:
CodecException
- If an error occurs decoding
-
readChunked
public Publisher<String> readChunked(Argument<String> type, MediaType mediaType, Headers httpHeaders, Publisher<ByteBuffer<?>> input) - Specified by:
readChunked
in interfaceChunkedMessageBodyReader<String>
-