Skip to content

Instantly share code, notes, and snippets.

@laevandus

laevandus/FileMemoryCache.swift Secret

Created Feb 11, 2021
Embed
What would you like to do?
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