Package org.springframework.http
Interface ZeroCopyHttpOutputMessage
- All Superinterfaces:
HttpMessage
,ReactiveHttpOutputMessage
public interface ZeroCopyHttpOutputMessage extends ReactiveHttpOutputMessage
Sub-interface ofReactiveOutputMessage
that has support for "zero-copy" file transfers.- Since:
- 5.0
- Author:
- Arjen Poutsma, Juergen Hoeller
- See Also:
- Zero-copy
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default reactor.core.publisher.Mono<Void>
writeWith(File file, long position, long count)
Use the givenFile
to write the body of the message to the underlying HTTP layer.reactor.core.publisher.Mono<Void>
writeWith(Path file, long position, long count)
Use the givenPath
to write the body of the message to the underlying HTTP layer.Methods inherited from interface org.springframework.http.HttpMessage
getHeaders
Methods inherited from interface org.springframework.http.ReactiveHttpOutputMessage
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith
Method Detail
writeWith
default reactor.core.publisher.Mono<Void> writeWith(File file, long position, long count)
Use the givenFile
to write the body of the message to the underlying HTTP layer.- Parameters:
file
- the file to transferposition
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferred- Returns:
- a publisher that indicates completion or error.
writeWith
reactor.core.publisher.Mono<Void> writeWith(Path file, long position, long count)
Use the givenPath
to write the body of the message to the underlying HTTP layer.- Parameters:
file
- the file to transferposition
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferred- Returns:
- a publisher that indicates completion or error.
- Since:
- 5.1