I have an InputStream and the size of the data that is going to come out (Response of HTTP request). For space complexity reasons I can't read the whole thing. What I want is to send the data directly into a new request body. I've tried doing this with OkHttp but I can't get it to work. I'm not aware of any other HTTP clients that can do this.
If at all possible I'd like to avoid messing around with Socket. Any advice?
Edit: Added restriction is that the solution must work with Java 8
 
     
     
    