这是我做的事情
FileOutputStream out = new FileOutputStream(
"/sdcard/Deltio1.jpg");
Bitmap e = BitmapFactory.decodeByteArray(imageData, 0,
imageData.length);
e.compress(Bitmap.CompressFormat.JPEG, 65, out);
out.close();
并检索它
FileInputStream fin = new FileInputStream("/sdcard/Deltio1.jpg");
ObjectInputStream in = new ObjectInputStream(fin);
Bitmap bitmap;
bitmap = (Bitmap) in.readObject();
ImageView photo = (ImageView) findViewById(R.id.katagelia_photo);
photo.setImageBitmap(bitmap);
抛出java.io.StreamCorruptedException
答案 0 :(得分:1)
找到它。但是我把它留待讨论,为什么第一个失败了。
Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);
options.inSampleSize = 2;