byteStream method
Returns content body as a single-subscription byte stream.
Implementation
@override
Stream<List<int>> byteStream() {
try {
final res = response;
if (res is http.StreamedResponse) {
return res.stream;
} else {
return http.ByteStream.fromBytes((res as http.Response).bodyBytes);
}
} on Exception catch (e) {
throw ClientException.openingStreamFailed(e);
}
}