Package com.azure.core.http.rest
Class StreamResponse
- All Implemented Interfaces:
Response<Flux<ByteBuffer>>
,Closeable
,AutoCloseable
REST response with a streaming content.
-
Constructor Summary
ConstructorDescriptionStreamResponse
(HttpRequest request, int statusCode, HttpHeaders headers, Flux<ByteBuffer> value) Deprecated.StreamResponse
(HttpResponse response) Creates aStreamResponse
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Disposes the connection associated with thisStreamResponse
.getValue()
The content of the HTTP response as a stream ofbyte buffers
.void
writeValueTo
(WritableByteChannel channel) Transfers content bytes to theWritableByteChannel
.writeValueToAsync
(AsynchronousByteChannel channel) Transfers content bytes to theAsynchronousByteChannel
.Methods inherited from class com.azure.core.http.rest.SimpleResponse
getHeaders, getRequest, getStatusCode
-
Constructor Details
-
StreamResponse
@Deprecated public StreamResponse(HttpRequest request, int statusCode, HttpHeaders headers, Flux<ByteBuffer> value) Deprecated.Creates aStreamResponse
.- Parameters:
request
- The request which resulted in this response.statusCode
- The status code of the HTTP response.headers
- The headers of the HTTP response.value
- The content of the HTTP response.
-
StreamResponse
Creates aStreamResponse
.- Parameters:
response
- The HTTP response.
-
-
Method Details
-
getValue
The content of the HTTP response as a stream ofbyte buffers
.- Specified by:
getValue
in interfaceResponse<Flux<ByteBuffer>>
- Overrides:
getValue
in classSimpleResponse<Flux<ByteBuffer>>
- Returns:
- The content of the HTTP response as a stream of
byte buffers
.
-
writeValueToAsync
Transfers content bytes to theAsynchronousByteChannel
.- Parameters:
channel
- The destinationAsynchronousByteChannel
.- Returns:
- A
Mono
that completes when transfer is completed.
-
writeValueTo
Transfers content bytes to theWritableByteChannel
.- Parameters:
channel
- The destinationWritableByteChannel
.- Throws:
UncheckedIOException
- When I/O operation fails.
-
close
public void close()Disposes the connection associated with thisStreamResponse
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
StreamResponse(HttpResponse)