Replace call to get.ResponseBody with get.getReponseBodyAsStream in ThumbnailsCacheMa...
authormasensio <masensio@solidgear.es>
Tue, 12 May 2015 11:25:36 +0000 (13:25 +0200)
committermasensio <masensio@solidgear.es>
Tue, 12 May 2015 11:25:36 +0000 (13:25 +0200)
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

index c375f8d..7825b95 100644 (file)
@@ -22,6 +22,7 @@
 package com.owncloud.android.datamodel;
 
 import java.io.File;
+import java.io.InputStream;
 import java.lang.ref.WeakReference;
 
 import org.apache.commons.httpclient.HttpStatus;
@@ -290,9 +291,11 @@ public class ThumbnailsCacheManager {
                                 GetMethod get = new GetMethod(uri);
                                 status = mClient.executeMethod(get);
                                 if (status == HttpStatus.SC_OK) {
-                                    byte[] bytes = get.getResponseBody();
-                                    Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0,
-                                            bytes.length);
+//                                    byte[] bytes = get.getResponseBody();
+//                                    Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0,
+//                                            bytes.length);
+                                    InputStream inputStream = get.getResponseBodyAsStream();
+                                    Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
                                     thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
 
                                     // Add thumbnail to cache