@Override public void put(final String key, final Entry entry) { diskCache.put(new StringKey(key), new DiskCache.Writer() { @Override public boolean write(OutputStream os) { CacheHeader header = new CacheHeader(key, entry); boolean success = header.writeHeader(os); if (success) { try { os.write(entry.data); } catch (IOException e) { success = false; if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Unable to write data", e); } } } return success; } }); }
@Override public void remove(String key) { diskCache.delete(new StringKey(key)); }