Code example for Bitmap.CompressFormat

Methods: name

0
 
    @Override 
    public String getFileNameForKey(String imageUrl) {
        // TODO: is hashCode appropriate to avoid collisions? 
        // the key is the image URL 
        return Integer.toHexString(imageUrl.hashCode()) + "." + compressedImageFormat.name();
    } 
 
    @Override 
    protected Bitmap readValueFromDisk(File file) {
        return BitmapFactory.decodeFile(file.getAbsolutePath());
    } 
 
    @Override 
    protected void writeValueToDisk(BufferedOutputStream ostream, Bitmap value) {
        value.compress(compressedImageFormat, cachedImageQuality, ostream);
    } 
}