I want to save a download image into raw folder. I tried below code for downloading image
public class Image extends FilterInputStream {
public Image(InputStream in) {
super(in);
}
public long skip(long n) throws IOException {
long m = 0L;
while (m < n) {
开发者_开发问答 long _m = in.skip(n-m);
if (_m == 0L) break;
m += _m;
}
return m;
}
}
The above code is working for downloading the image, so I want to save that download in raw folder. Please tell me the process.
You can't modify the resources folders at runtime and raw is one of them. Store the file to any other location: internal memory or external memory. Or even to the db.
精彩评论