Caching bitmap code confusing
<p>Can anyone comment out this code to give me a better idea of whats going on in this code?</p>

<p>Thanks.</p>

<pre><code>private void putBitmapInDiskCache(Uri url, Bitmap avatar) {     
File cacheDir = new   File(context.getCacheDir(), "thumbnails");   
File cacheFile = new File(cacheDir, ""+url.hashCode());    
 try {      
  cacheFile.createNewFile();       
  FileOutputStream fos = new FileOutputStream(cacheFile);      
 avatar.compress(CompressFormat.PNG, 100, fos);       
 fos.flush();       
 fos.close();    
 } catch (Exception e) {      
Log.e(LOG_TAG, "Error when saving image to cache. ", e);     
}  
 } 
</code></pre>

<p>To read them it's similar:</p>

<pre><code>fis = new FileInputStream(cacheFile);   
Bitmap local = BitmapFactory.decodeStream(fis); 
</code></pre>
