@LevelUpApi(contract=INTERNAL) public class StreamingResponse extends AbstractResponse<InputStream>
AbstractResponse
that uses a streaming interface where the response data is read from
a stream.Modifier | Constructor and Description |
---|---|
protected |
StreamingResponse(Exception error)
Constructor for an error response.
|
protected |
StreamingResponse(HttpURLConnection connection)
Constructor for a successful response.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this connection.
|
boolean |
equals(Object obj) |
InputStream |
getData() |
int |
hashCode() |
String |
toString() |
getError, getHttpHeader, getHttpHeaders, getHttpStatusCode
protected StreamingResponse(HttpURLConnection connection) throws IOException
connection
- the @link HttpURLConnection} that this response is for.IOException
- if the @code InputStream} from the connection cannot be read.protected StreamingResponse(Exception error)
error
- any exception that was thrown during the request.public final InputStream getData()
getData
in class AbstractResponse<InputStream>
InputStream
containing the data from the server's responsepublic final void close()
public String toString()
toString
in class AbstractResponse<InputStream>