use of com.stanfy.enroscar.net.cache.EnhancedResponseCache in project enroscar by stanfy.
the class ImageRequest method writeBitmapToDisk.
void writeBitmapToDisk(final Bitmap bitmap) throws IOException {
EnhancedResponseCache cache = (EnhancedResponseCache) manager.getImagesResponseCache();
OutputStream output = new FileOutputStream(cache.getLocalPath(url));
output = manager.getBuffersPool().bufferize(output, IMAGES_BUFFER_SIZE);
try {
final int quality = 100;
bitmap.compress(Bitmap.CompressFormat.PNG, quality, output);
} finally {
IoUtils.closeQuietly(output);
}
}
Aggregations