A two-level LRU cache composed of a smaller, first level LruCache
in memory
and a larger, second level DiskLruCache
.
The keys must be of String
type. The values must be convertible to and from
a byte stream using a Converter
.
There are two ways to include TwoLevelLruCache in your projects:
-
You can download the released jar file in the Downloads page.
-
If you use Maven to build your project you can simply add a dependency to this library.
<dependency> <groupId>com.wu-man</groupId> <artifactId>twolevellrucache</artifactId> <version>0.8.0</version> </dependency>
TwoLevelLruCache depends on the following libraries:
- LruCache by Jesse Wilson
- DiskLruCache by Google Android and Jake Wharton
- Apache Commons IO (mainly for quietly closing streams, may be removed in the future)
If you would like to contribute code to TwoLevelLruCache you can do so through GitHub by forking the repository and sending a pull request.
- David Wu [email protected] - http://blog.wu-man.com
Copyright 2012 David Wu
Copyright 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.