@Test public void size() throws Exception { StreamCache streamCache = new StreamCache(Constants.HOUR_MS); FileInStream is = mock(FileInStream.class); FileOutStream os = mock(FileOutStream.class); Assert.assertEquals(0, streamCache.size()); int isId = streamCache.put(is); Assert.assertEquals(1, streamCache.size()); int osId = streamCache.put(os); Assert.assertEquals(2, streamCache.size()); streamCache.invalidate(isId); Assert.assertEquals(1, streamCache.size()); streamCache.invalidate(osId); Assert.assertEquals(0, streamCache.size()); }
public long size() { return mInStreamCache.size() + mOutStreamCache.size(); }
StreamCache { public long size() { return mInStreamCache.size() + mOutStreamCache.size(); } }
StreamCache { public long size() { return mInStreamCache.size() + mOutStreamCache.size(); } StreamCache(long timeoutMs); }
StreamCache { public long size() { return mInStreamCache.size() + mOutStreamCache.size(); } StreamCache(long timeoutMs); FileInStream getInStream(Integer key); FileOutStream getOutStream(Integer key); Integer put(FileInStream is); Integer put(FileOutStream os); @Nullable Closeable invalidate(Integer key); long size(); }
StreamCache { public long size() { return mInStreamCache.size() + mOutStreamCache.size(); } StreamCache(long timeoutMs); FileInStream getInStream(Integer key); FileOutStream getOutStream(Integer key); Integer put(FileInStream is); Integer put(FileOutStream os); @Nullable Closeable invalidate(Integer key); long size();  }