ByteDeque

fun ByteDeque(initialCapacity: Int = 16, scaleFactor: Float = 1.5f, maxSize: Int)

Constructs a new Deque instance.

Parameters

initialCapacity

Initial capacity of the internal data container backing the created deque.

Up to this many values may be added to the deque before the internal data container needs to be resized and reallocated.

scaleFactor

Internal storage reallocation scale factor.

If/when this Deque determines it needs to resize its internal data container to hold additional values being pushed, the internal data container will be resized at a rate of capacity * scaleFactor.

If the scale factor returns a value that is equal to or less than the current capacity, the resize will fall back to a size of capacity + 1.

Default: 1.5

maxSize

Maximum size this deque can grow to.

If adding a value to this Deque would push the size or capacity of the deque to be greater than maxSize then an exception will be thrown.

Default: 2,147,483,647 (Int.MAX_VALUE)