Skip to content

A first-in first-out file cache that uses your app's internal cache directory

License

Notifications You must be signed in to change notification settings

ScaCap/FIFOCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b0658c6 · Feb 6, 2024

History

11 Commits
Feb 18, 2018
Feb 18, 2018
May 1, 2018
Feb 13, 2018
Feb 13, 2018
Feb 26, 2018
Feb 26, 2018
Feb 13, 2018
Feb 13, 2018
Feb 13, 2018
Feb 13, 2018
Feb 13, 2018

Repository files navigation

FIFOCache

A first-in first-out file cache that uses your app's internal cache directory. More details here.

Usage

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //...
        FIFOCache cache = new FIFOCache(this);
		
        InputStream inputStream = getAssets().open("sample.pdf");
        long size = getAssets().openFd("sample.pdf").getLength();
        cache.cache(inputStream, "sample", size);
        //...
        File cachedFile = cache.retrieve("sample");
    }
}

Installation

repositories {
    maven { url "https://jitpack.io" }
}


dependencies {
    implementation "com.github.ScaCap:FIFOCache:1.0.0"
}

License

FIFOCache is Open Source software released under the Apache 2.0 license.