Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created February 11, 2021 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/9a7b1564fff2eec877eb8ce8a2ca3ddb to your computer and use it in GitHub Desktop.
Save laevandus/9a7b1564fff2eec877eb8ce8a2ca3ddb to your computer and use it in GitHub Desktop.
final class FileMemoryCache {
init(byteCountLimit: Int)
/// Returns data for the byte range
func data(for byteRange: CountableRange<Int>) -> DispatchData?
/// Caches data for the byte range and evicts older data when exceeding byte count limit
func set(_ data: DispatchData, byteRange: CountableRange<Int>)
/// Removes everything from the cache
func removeAll()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment