All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.httpcomponent.httpclient.implementation.StreamRequestProducer Maven / Gradle / Ivy

The newest version!
package com.aliyun.httpcomponent.httpclient.implementation;

import com.aliyun.apache.hc.client5.http.async.methods.SimpleHttpRequest;
import com.aliyun.apache.hc.core5.http.HttpRequest;
import com.aliyun.apache.hc.core5.http.nio.AsyncEntityProducer;
import com.aliyun.apache.hc.core5.http.nio.support.BasicRequestProducer;
import com.aliyun.apache.hc.core5.util.Args;

import java.io.InputStream;

public class StreamRequestProducer  extends BasicRequestProducer {
    StreamRequestProducer(HttpRequest request, AsyncEntityProducer dataProducer) {
        super(request, dataProducer);
    }

    public static StreamRequestProducer create(SimpleHttpRequest request, InputStream inputsteam) {
        Args.notNull(request, "Request");
        StreamEntityProducer entityProducer = new StreamEntityProducer(inputsteam);
        return new StreamRequestProducer(request, entityProducer);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy