public static class

BodyDeferringAsyncHandler.BodyDeferringInputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.ning.http.client.BodyDeferringAsyncHandler.BodyDeferringInputStream

Class Overview

A simple helper class that is used to perform automatic "join" for async download and the error checking of the Future of the request.

Summary

[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
BodyDeferringAsyncHandler.BodyDeferringInputStream(Future<Response> future, BodyDeferringAsyncHandler bdah, InputStream in)
Public Methods
void close()
Closes the input stream, and "joins" (wait for complete execution together with potential exception thrown) of the async request.
Response getAsapResponse()
Delegates to getResponse().
Response getLastResponse()
Delegates to Future#get() method.
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public BodyDeferringAsyncHandler.BodyDeferringInputStream (Future<Response> future, BodyDeferringAsyncHandler bdah, InputStream in)

Public Methods

public void close ()

Closes the input stream, and "joins" (wait for complete execution together with potential exception thrown) of the async request.

Throws
IOException

public Response getAsapResponse ()

Delegates to getResponse(). Will blocks as long as headers arrives only. Might return null. See getResponse() method for details.

Returns
Throws
InterruptedException
IOException

public Response getLastResponse ()

Delegates to Future#get() method. Will block as long as complete response arrives.

Returns
Throws
InterruptedException
ExecutionException
InterruptedException