From 86c71b8458444dfcbf2c3919961b86bc92f65657 Mon Sep 17 00:00:00 2001 From: Shen Lin Date: Fri, 9 Dec 2016 11:06:29 +0800 Subject: Fix NegativeArraySizeException in DiskBasedCache.streamToBytes Issue discussion can be found at https://groups.google.com/forum/#!topic/volley-users/0W-oI6za8VY --- src/main/java/com/android/volley/toolbox/DiskBasedCache.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/android/volley/toolbox/DiskBasedCache.java b/src/main/java/com/android/volley/toolbox/DiskBasedCache.java index c76d39a..f724d72 100644 --- a/src/main/java/com/android/volley/toolbox/DiskBasedCache.java +++ b/src/main/java/com/android/volley/toolbox/DiskBasedCache.java @@ -122,6 +122,10 @@ public class DiskBasedCache implements Cache { VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString()); remove(key); return null; + } catch (NegativeArraySizeException e) { + VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString()); + remove(key); + return null; } finally { if (cis != null) { try { -- cgit v1.2.3