From a60c40cb4cc511d6d9a183ffcdeb8a67542d564b Mon Sep 17 00:00:00 2001 From: Woosung Jeon Date: Thu, 18 Apr 2013 18:06:48 +0900 Subject: [PATCH] Fix java.lang.ClassCastException: String cannot be cast to byte[] This bug occurs with BinaryHttpResponseHandler when failed to download data. at BinaryHttpResponseHandler.handleMessage(BinaryHttpResponseHandler.java:145) --- .classpath | 1 + src/com/loopj/android/http/BinaryHttpResponseHandler.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.classpath b/.classpath index 14fcf527f..51011ca96 100644 --- a/.classpath +++ b/.classpath @@ -4,5 +4,6 @@ + diff --git a/src/com/loopj/android/http/BinaryHttpResponseHandler.java b/src/com/loopj/android/http/BinaryHttpResponseHandler.java index 7d675a593..c96404fb3 100644 --- a/src/com/loopj/android/http/BinaryHttpResponseHandler.java +++ b/src/com/loopj/android/http/BinaryHttpResponseHandler.java @@ -143,7 +143,7 @@ protected void handleMessage(Message msg) { switch(msg.what) { case SUCCESS_MESSAGE: response = (Object[])msg.obj; - handleSuccessMessage(((Integer) response[0]).intValue() , (byte[]) response[1]); + handleSuccessMessage(((Integer) response[0]).intValue(), response[1].toString().getBytes()); break; case FAILURE_MESSAGE: response = (Object[])msg.obj;