public class ByteAsyncHttpResponse extends AsyncHttpResponse
| Modifier and Type | Field and Description |
|---|---|
protected static int |
FAIL_BYTE_ARRAY
Indicate the response as a fail byte array message
|
protected static int |
SUCCESS_BYTE_ARRAY
Indicate the response as a valid byte array message
|
FAIL, FINISH, START, SUCCESS| Constructor and Description |
|---|
ByteAsyncHttpResponse() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleFailByteArrayMessage(java.lang.Throwable error,
byte[] responseBody)
Handle the error message and call the callback
|
boolean |
handleMessage(Message message) |
protected void |
handleSuccessByteArrayMessage(int statusCode,
byte[] responseBody)
Handle the success message and call the callback
|
void |
onError(java.lang.Throwable error,
byte[] content)
Callback that indicate the response as finished with a fail
but have a valid byte array response
|
void |
onSuccess(int statusCode,
byte[] content)
Callback that indicate the response as finished with success
|
protected void |
sendFailMessage(java.lang.Throwable error,
byte[] responseBody)
Send a fail message to the handler
|
protected void |
sendSuccessMessage(int statusCode,
byte[] responseBody)
Send a success byte array message to handler
|
handleFailMessage, handleSuccessMessage, obtainMessage, onError, onFinish, onStart, onSuccess, sendEndMessage, sendFailMessage, sendMessage, sendStartMessage, sendSuccessMessageprotected static final int SUCCESS_BYTE_ARRAY
protected static final int FAIL_BYTE_ARRAY
public void onSuccess(int statusCode,
byte[] content)
statusCode - the status code of this requestcontent - the content of this requestpublic void onError(java.lang.Throwable error,
byte[] content)
error - the stack trace of the error messagecontent - the content of this requestprotected void sendSuccessMessage(int statusCode,
byte[] responseBody)
statusCode - the status code of the requestresponseBody - the response body of the request or nullprotected void sendFailMessage(java.lang.Throwable error,
byte[] responseBody)
error - the related stack trace of the requestresponseBody - the response body of the request or nullprotected void handleSuccessByteArrayMessage(int statusCode,
byte[] responseBody)
statusCode - the status code of the requestresponseBody - the response body or nullonSuccess(int, byte[])protected void handleFailByteArrayMessage(java.lang.Throwable error,
byte[] responseBody)
error - the stack trace of this responseresponseBody - the response body of this request or nullonError(java.lang.Throwable, byte[])public boolean handleMessage(Message message)
handleMessage in class AsyncHttpResponse