@Override
    public final void consumeResponse(
            final HttpResponse response,
            final EntityDetails entityDetails,
            final HttpContext context,
            final FutureCallback<T> resultCallback) throws HttpException, IOException {
        this.resultCallback = resultCallback;
        if (entityDetails != null) {
            try {
                final ContentType contentType = ContentType.parse(entityDetails.getContentType());
                start(response, contentType != null ? contentType : ContentType.DEFAULT_BINARY);
            } catch (final UnsupportedCharsetException ex) {
                throw new UnsupportedEncodingException(ex.getMessage());
            }
        } else {
            start(response, null);
            completed();
        }

    }
Triggered to generate object that represents a result of response message processing.

@return the result of response processing.
httpclient5/src/main/java/org/apache/hc/client5/http/async/methods/AbstractBinResponseConsumer.java