【发布时间】:2015-04-18 04:13:44
【问题描述】:
我在设备私有存储中存储了一些图像,例如:
InputStream inputStream = response.getEntity().getContent();
FileOutputStream fileOutputStream = openFileOutput("someImage.jpeg", cont.MODE_PRIVATE);
int read = 0;
byte[] buffer = new byte[32768];
while((read = inputStream.read(buffer)) > 0) {
fileOutputStream.write(buffer, 0, read);
}
fileOutputStream.close();
inputStream.close();
然后我想读取该图像并将其存储为位图以将其显示给用户,我不知道该怎么做才能做到这一点!我想再次从私有存储中读取图像,然后将其转换为位图。 有什么经验吗?
【问题讨论】:
-
这可能不是一个好主意,因为用户可以删除该图像。你为什么要那样做?
标签: android image bitmap fileinputstream fileoutputstream