woopsie
authorNiki Roo <niki@nikiroo.be>
Tue, 28 May 2019 21:19:25 +0000 (23:19 +0200)
committerNiki Roo <niki@nikiroo.be>
Tue, 28 May 2019 21:19:25 +0000 (23:19 +0200)
src/be/nikiroo/utils/CacheMemory.java

index 8f9e7253a5c8b62776db858d9414ebbd3ec10c36..232b63247f9ab0ccd9f20da405d33d4a0171adb8 100644 (file)
@@ -70,13 +70,17 @@ public class CacheMemory extends Cache {
        }
 
        @Override
-       public void save(InputStream in, String uniqueID) throws IOException {
-               data.put(getKey(uniqueID), IOUtils.toByteArray(in));
+       public long save(InputStream in, String uniqueID) throws IOException {
+               byte[] bytes = IOUtils.toByteArray(in);
+               data.put(getKey(uniqueID), bytes);
+               return bytes.length;
        }
 
        @Override
-       public void save(InputStream in, URL url) throws IOException {
-               data.put(getKey(url), IOUtils.toByteArray(in));
+       public long save(InputStream in, URL url) throws IOException {
+               byte[] bytes = IOUtils.toByteArray(in);
+               data.put(getKey(url), bytes);
+               return bytes.length;
        }
 
        /**