Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,28 @@ public synchronized Entry get(String key) {
if (entry == null) {
return null;
}

Entry resultEntry = null;
File file = getFileForKey(key);
CountingInputStream cis = null;
try {
cis = new CountingInputStream(new BufferedInputStream(new FileInputStream(file)));
CacheHeader.readHeader(cis); // eat header
byte[] data = streamToBytes(cis, (int) (file.length() - cis.bytesRead));
return entry.toCacheEntry(data);
resultEntry = entry.toCacheEntry(data);
} catch (IOException e) {
VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
remove(key);
return null;
resultEntry = null;
} finally {
if (cis != null) {
try {
cis.close();
} catch (IOException ioe) {
return null;
resultEntry = null;
}
}
}
return resultEntry;
}

/**
Expand Down