- int size = img.getData().length;
- Bitmap image = BitmapFactory.decodeByteArray(img.getData(), 0, size);
+ byte[] array = img.getData();
+ int size = array.length;
+ // TODO: check if we can use a stream, too
+ Bitmap image = BitmapFactory.decodeByteArray(array, 0, size);