作者: luckiejacky 時間: 2018-3-28 08:11 標題: [Android] Display Bitmap
當我的bitmap send to another android, it will crash
請CHING指教..
Sender:
- ByteArrayOutputStream stream = new ByteArrayOutputStream();
- bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
- byte[] byteArray = stream.toByteArray();
- socket = ssocket.accept();
- Log.e(logtag, "Get Data Now");
- byteArray = readBytes();
- ByteArrayInputStream arrayInputStream = new ByteArrayInputStream(byteArray);
- Bitmap bitmap = BitmapFactory.decodeStream(arrayInputStream); //imageView.setImageBitmap(bitmap); <<< Throw Exception!
作者: 燕飛 時間: 2018-3-28 08:41
Decode encode pair 係咪一對?
via HKEPC Reader for Android
作者: KinChungE 時間: 2018-3-28 09:24
有冇響收果邊check下byteArray size同sender果邊一唔一樣?
