all controller methods. This is the effect of `@RestController`, which is nothing more
than a meta-annotation marked with `@Controller` and `@ResponseBody`.
A `Resource` object can be returned for file content, copying the `InputStream`
content of the provided resource to the response `OutputStream`. Note that the
`InputStream` should be lazily retrieved by the `Resource` handle in order to reliably
close it after it has been copied to the response. If you are using `InputStreamResource`
for such a purpose, make sure to construct it with an on-demand `InputStreamSource`
(e.g. through a lambda expression that retrieves the actual `InputStream`).
You can use `@ResponseBody` with reactive types.
See xref:web/webmvc/mvc-ann-async.adoc[Asynchronous Requests] and xref:web/webmvc/mvc-ann-async.adoc#mvc-ann-async-reactive-types[Reactive Types] for more details.
@ -98,7 +136,7 @@ public class InputStreamResource extends AbstractResource {
@@ -98,7 +136,7 @@ public class InputStreamResource extends AbstractResource {
"do not use InputStreamResource if a stream needs to be read multiple times");
}
this.read=true;
returnthis.inputStream;
returnthis.inputStreamSource.getInputStream();
}
/**
@ -117,7 +155,7 @@ public class InputStreamResource extends AbstractResource {
@@ -117,7 +155,7 @@ public class InputStreamResource extends AbstractResource {
@ -125,7 +163,7 @@ public class InputStreamResource extends AbstractResource {
@@ -125,7 +163,7 @@ public class InputStreamResource extends AbstractResource {