private PooledByteBuffer readFromDiskCache(final CacheKey key) throws IOException {
  try {
    FLog.v(TAG,"Disk cache read for %s",key.toString());
    final BinaryResource diskCacheResource=mFileCache.getResource(key);
    if (diskCacheResource == null) {
      FLog.v(TAG,"Disk cache miss for %s",key.toString());
      mImageCacheStatsTracker.onDiskCacheMiss();
      return null;
    }
 else {
      FLog.v(TAG,"Found entry in disk cache for %s",key.toString());
      mImageCacheStatsTracker.onDiskCacheHit();
    }
    PooledByteBuffer byteBuffer;
    final InputStream is=diskCacheResource.openStream();
    try {
      byteBuffer=mPooledByteBufferFactory.newByteBuffer(is,(int)diskCacheResource.size());
    }
  finally {
      is.close();
    }
    FLog.v(TAG,"Successful read from disk cache for %s",key.toString());
    return byteBuffer;
  }
 catch (  IOException ioe) {
    FLog.w(TAG,ioe,"Exception reading from cache for %s",key.toString());
    mImageCacheStatsTracker.onDiskCacheGetFail();
    throw ioe;
  }
}

private PooledByteBuffer readFromDiskCache ( final CacheKey key ) throws IOException { try { FLog . v ( TAG , "Disk cache read for %s" , key . toString ( ) ) ; final BinaryResource diskCacheResource = mFileCache . getResource ( key ) ; if ( diskCacheResource == null ) { FLog . v ( TAG , "Disk cache miss for %s" , key . toString ( ) ) ; mImageCacheStatsTracker . onDiskCacheMiss ( ) ; return null ; } else { FLog . v ( TAG , "Found entry in disk cache for %s" , key . toString ( ) ) ; mImageCacheStatsTracker . onDiskCacheHit ( ) ; } PooledByteBuffer byteBuffer ; final InputStream is = diskCacheResource . openStream ( ) ; try { byteBuffer = mPooledByteBufferFactory . newByteBuffer ( is , ( int ) diskCacheResource . size ( ) ) ; } finally { is . close ( ) ; } FLog . v ( TAG , "Successful read from disk cache for %s" , key . toString ( ) ) ; return byteBuffer ; } catch ( IOException ioe ) { FLog . w ( TAG , ioe , "Exception reading from cache for %s" , key . toString ( ) ) ; mImageCacheStatsTracker . onDiskCacheGetFail ( ) ; throw ioe ; } }
performs disk cache read . in case of any exception null is returned .
