Top Description Methods
org.springframework.http

public Interface ZeroCopyHttpOutputMessage

extends ReactiveHttpOutputMessage
Known Direct Implementers
org.springframework.http.client.reactive.ReactorClientHttpRequest, org.springframework.http.client.reactive.ReactorNetty2ClientHttpRequest, org.springframework.http.server.reactive.ReactorNetty2ServerHttpResponse, org.springframework.http.server.reactive.ReactorServerHttpResponse, org.springframework.http.server.reactive.UndertowServerHttpResponse
Imports
java.io.File, java.nio.file.Path, reactor.core.publisher.Mono

Sub-interface of ReactiveOutputMessage that has support for "zero-copy" file transfers.
Authors
Arjen Poutsma, Juergen Hoeller
Since
5.0
See Also
Zero-copy

Method Summary

Modifier and TypeMethod and Description
public default Mono<Void>

Returns:

a publisher that indicates completion or error.
writeWith
(File
the file to transfer
file
,
long
the position within the file from which the transfer is to begin
position
,
long
the number of bytes to be transferred
count
)

Use the given File to write the body of the message to the underlying HTTP layer.

public Mono<Void>

Returns:

a publisher that indicates completion or error.
writeWith
(Path
the file to transfer
file
,
long
the position within the file from which the transfer is to begin
position
,
long
the number of bytes to be transferred
count
)

Use the given Path to write the body of the message to the underlying HTTP layer.

Inherited from org.springframework.http.ReactiveHttpOutputMessage:
beforeCommitbufferFactoryisCommittedsetCompletewriteAndFlushWithwriteWith

Method Detail

writeWithback to summary
public default Mono<Void> writeWith(File file, long position, long count)

Use the given File to write the body of the message to the underlying HTTP layer.

Parameters
file:File

the file to transfer

position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

Returns:Mono<Void>

a publisher that indicates completion or error.

writeWithback to summary
public Mono<Void> writeWith(Path file, long position, long count)

Use the given Path to write the body of the message to the underlying HTTP layer.

Parameters
file:Path

the file to transfer

position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

Returns:Mono<Void>

a publisher that indicates completion or error.

Since
5.1