Construct SpaceSaver with given capacity containing a single item with provided exact count.
Construct SpaceSaver with given capacity containing a single item with provided exact count. This is the public api to create a new SpaceSaver.
Construct SpaceSaver with given capacity containing a single item.
Construct SpaceSaver with given capacity containing a single item. This is the public api to create a new SpaceSaver.
Encodes the SpaceSaver as a sequence of bytes containing in order - 1 byte: 1/2 => 1 = SSOne, 2 = SSMany - 4 bytes: the capacity - N bytes: the item/counters (counters as length + N*(item size + item + 2 * counters)