Package io.micronaut.http.server.body
Class InputStreamBodyWriter
java.lang.Object
io.micronaut.http.server.body.InputStreamBodyWriter
- All Implemented Interfaces:
- MessageBodyWriter<InputStream>,- ResponseBodyWriter<InputStream>
@Internal
@Singleton
public final class InputStreamBodyWriter
extends Object
implements ResponseBodyWriter<InputStream>
Body writer for 
InputStreams.- Since:
- 4.0.0
- Author:
- Graeme Rocher
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final HttpServerConfiguration.FileTypeHandlerConfiguration
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanhandleIfModifiedAndHeaders(HttpRequest<?> request, MutableHttpResponse<?> response, FileCustomizableResponseType systemFile, MutableHttpResponse<?> nettyResponse) protected ByteBodyHttpResponse<?>notModified(ByteBodyFactory bodyFactory, MutableHttpResponse<?> originalResponse) protected voidsetDateAndCacheHeaders(MutableHttpResponse response, long lastModified) protected voidsetDateHeader(MutableHttpResponse response) writePiece(@NonNull ByteBodyFactory bodyFactory, @NonNull HttpRequest<?> request, @NonNull HttpResponse<?> response, @NonNull Argument<InputStream> type, @NonNull MediaType mediaType, InputStream object) Write a piece of a larger response, e.g.voidwriteTo(Argument<InputStream> type, MediaType mediaType, InputStream object, MutableHeaders outgoingHeaders, OutputStream outputStream) Writes an object to the given output stream.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.body.MessageBodyWritercreateSpecific, isBlocking, isWriteable, writeToMethods inherited from interface io.micronaut.http.body.ResponseBodyWriterwrite
- 
Field Details- 
configuration
 
- 
- 
Method Details- 
writePiecepublic CloseableByteBody writePiece(@NonNull @NonNull ByteBodyFactory bodyFactory, @NonNull @NonNull HttpRequest<?> request, @NonNull @NonNull HttpResponse<?> response, @NonNull @NonNull Argument<InputStream> type, @NonNull @NonNull MediaType mediaType, InputStream object) Description copied from interface:ResponseBodyWriterWrite a piece of a larger response, e.g. when writing a Publisher or a part of a multipart response. In this case, response headers cannot be modified.- Specified by:
- writePiecein interface- ResponseBodyWriter<InputStream>
- Parameters:
- bodyFactory- The buffer factory
- request- The request
- response- The response this piece is part of
- type- The type of this piece
- mediaType- The media type of this piece
- object- The piece to write
- Returns:
- The response bytes
 
- 
writeTopublic void writeTo(Argument<InputStream> type, MediaType mediaType, InputStream object, MutableHeaders outgoingHeaders, OutputStream outputStream) throws CodecException Description copied from interface:MessageBodyWriterWrites an object to the given output stream.- Specified by:
- writeToin interface- MessageBodyWriter<InputStream>
- Parameters:
- type- The type
- mediaType- The media type
- object- The object to write
- outgoingHeaders- The HTTP headers
- outputStream- The output stream
- Throws:
- CodecException- If an error occurs decoding
 
- 
handleIfModifiedAndHeadersprotected boolean handleIfModifiedAndHeaders(HttpRequest<?> request, MutableHttpResponse<?> response, FileCustomizableResponseType systemFile, MutableHttpResponse<?> nettyResponse) 
- 
setDateAndCacheHeaders- Parameters:
- response- The Http response
- lastModified- The last modified
 
- 
setDateHeader- Parameters:
- response- The Http response
 
- 
notModifiedprotected ByteBodyHttpResponse<?> notModified(ByteBodyFactory bodyFactory, MutableHttpResponse<?> originalResponse) 
 
-