1、获取InputStream
public void onSuccess(InputStream result) { Bitmap bitmap = null; try { byte[] data = AppUtils.readStream(result); if (data != null) { bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); } imageView.setImageBitmap(bitmap); } catch (Exception e) { e.printStackTrace(); } }
2、
/* * 得到图片字节流 数组大小 * */ public static byte[] readStream(InputStream inStream) throws Exception { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buffer = new byte[1024]; int len = 0; while ((len = inStream.read(buffer)) != -1) { outStream.write(buffer, 0, len); } by