StreamResponse Class
- java.
lang. Object - com.
azure. core. http. rest. SimpleResponse<T> - com.
azure. core. http. rest. StreamResponse
- com.
- com.
Implements
public final class StreamResponse
extends SimpleResponse<reactor.core.publisher.Flux<ByteBuffer>>
implements Closeable
This class represents a REST response with a streaming content. It encapsulates the HTTP request that resulted in the response, the status code of the HTTP response, the headers of the HTTP response, and the content of the HTTP response as a stream of byte buffers.
It also provides methods to write the content of the HTTP response to a AsynchronousByteChannel or a WritableByteChannel, and to dispose the connection associated with the response.
Constructor Summary
| Constructor | Description |
|---|---|
| StreamResponse(HttpRequest request, int statusCode, HttpHeaders headers, Flux<ByteBuffer> value) |
Deprecated Creates a StreamResponse. |
| StreamResponse(HttpResponse response) |
Creates a StreamResponse. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
close()
Disposes the connection associated with this StreamResponse. |
|
reactor.core.publisher.Flux<Byte |
getValue()
The content of the HTTP response as a stream of byte buffers. |
| void |
writeValueTo(WritableByteChannel channel)
Transfers content bytes to the WritableByteChannel. |
| reactor.core.publisher.Mono<Void> |
writeValueToAsync(AsynchronousByteChannel channel)
Transfers content bytes to the AsynchronousByteChannel. |
Methods inherited from SimpleResponse
Methods inherited from java.lang.Object
Constructor Details
StreamResponse
@Deprecated
public StreamResponse(HttpRequest request, int statusCode, HttpHeaders headers, Flux<ByteBuffer> value)
Deprecated
Creates a StreamResponse.
Parameters:
StreamResponse
public StreamResponse(HttpResponse response)
Creates a StreamResponse.
Parameters:
Method Details
close
public void close()
Disposes the connection associated with this StreamResponse.
getValue
public Flux<ByteBuffer> getValue()
The content of the HTTP response as a stream of byte buffers.
Overrides:
StreamResponse.getValue()Returns:
writeValueTo
public void writeValueTo(WritableByteChannel channel)
Transfers content bytes to the WritableByteChannel.
Parameters:
writeValueToAsync
public Mono<Void> writeValueToAsync(AsynchronousByteChannel channel)
Transfers content bytes to the AsynchronousByteChannel.
Parameters:
Returns: