add

abstract fun add(data: ByteBuf): Int

Adds the specified data to the cache.

If the cache is full, the oldest element (at index 0) is evicted, and all other elements are shifted down by one (index 1 becomes 0, etc.). The new element is then added at the last index (capacity - 1).

Return

The index at which the element was added.