Interface StreamingHttpOutputMessage.Body
- Enclosing interface:
StreamingHttpOutputMessage
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines the contract for bodies that can be written directly to an
OutputStream. Useful with HTTP client libraries that provide
indirect access to an OutputStream via a callback mechanism.- Since:
- 4.0
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanIndicates whether this body is capable of writing its data more than once.voidwriteTo(OutputStream outputStream) Write this body to the givenOutputStream.
-
Method Details
-
writeTo
Write this body to the givenOutputStream.- Parameters:
outputStream- the output stream to write to- Throws:
IOException- in case of I/O errors
-
repeatable
default boolean repeatable()Indicates whether this body is capable of writing its data more than once. The default implementation returnsfalse.- Returns:
trueif this body can be written repeatedly,falseotherwise- Since:
- 6.1
-