Package io.micronaut.http.netty.body
Class NettyCharSequenceBodyWriter
java.lang.Object
io.micronaut.http.netty.body.NettyCharSequenceBodyWriter
- All Implemented Interfaces:
MessageBodyWriter<CharSequence>
,NettyBodyWriter<CharSequence>
@Singleton
@Replaces(CharSequenceBodyWriter.class)
@Internal
public final class NettyCharSequenceBodyWriter
extends Object
implements MessageBodyWriter<CharSequence>, NettyBodyWriter<CharSequence>
A JSON body should not be escaped or parsed as a JSON value.
- Since:
- 4.6
- Author:
- Denis Stepanov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
writeTo
(Argument<CharSequence> type, MediaType mediaType, CharSequence object, MutableHeaders outgoingHeaders, OutputStream outputStream) Writes an object to the given output stream.void
writeTo
(HttpRequest<?> request, MutableHttpResponse<CharSequence> outgoingResponse, Argument<CharSequence> type, MediaType mediaType, CharSequence object, NettyWriteContext nettyContext) Write an object to the given context.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.MessageBodyWriter
createSpecific, isBlocking, isWriteable, writeTo
-
Constructor Details
-
NettyCharSequenceBodyWriter
public NettyCharSequenceBodyWriter()
-
-
Method Details
-
writeTo
public void writeTo(HttpRequest<?> request, MutableHttpResponse<CharSequence> outgoingResponse, Argument<CharSequence> type, MediaType mediaType, CharSequence object, NettyWriteContext nettyContext) throws CodecException Description copied from interface:NettyBodyWriter
Write an object to the given context.- Specified by:
writeTo
in interfaceNettyBodyWriter<CharSequence>
- Parameters:
request
- The associated requestoutgoingResponse
- The outgoing response.type
- The typemediaType
- The media typeobject
- The object to writenettyContext
- The netty context- Throws:
CodecException
- If an error occurs decoding
-
writeTo
public void writeTo(Argument<CharSequence> type, MediaType mediaType, CharSequence object, MutableHeaders outgoingHeaders, OutputStream outputStream) throws CodecException Description copied from interface:MessageBodyWriter
Writes an object to the given output stream.- Specified by:
writeTo
in interfaceMessageBodyWriter<CharSequence>
- Parameters:
type
- The typemediaType
- The media typeobject
- The object to writeoutgoingHeaders
- The HTTP headersoutputStream
- The output stream- Throws:
CodecException
- If an error occurs decoding
-