IoCachePolicy

data class IoCachePolicy(val enabled: Boolean = true, val readChunkBytes: Int = 256 * 1024, val backWindowBytes: Long = 8L * 1024 * 1024, val forwardWindowBytes: Long = 32L * 1024 * 1024)

The byte cache: one contiguous RAM window over an MediaIo's bytes. Reads pull readChunkBytes at a time and append to the window; a seek that lands inside the window is served from RAM without touching the source, which is what makes a small seek-back free on a network stream. The window keeps at least backWindowBytes behind the cursor before anything is evicted, and forwardWindowBytes in total; Progress.bufferedRanges reports the window, time-mapped.

Constructors

Link copied to clipboard
constructor(enabled: Boolean = true, readChunkBytes: Int = 256 * 1024, backWindowBytes: Long = 8L * 1024 * 1024, forwardWindowBytes: Long = 32L * 1024 * 1024)

Properties

Link copied to clipboard

How many bytes behind the cursor stay in RAM, at least, for free backward seeks.

Link copied to clipboard
Link copied to clipboard

The whole window's byte budget, back window included.

Link copied to clipboard

How much one upstream read pulls. Bigger means fewer network round trips.