constructor(type) {
    super()
    this.type = type
    this.state = "empty"
    this.lastValue = undefined
    this.count = 0
    this.literal = []
  }
An encoder that uses run-length encoding to compress sequences of repeated
values. The constructor argument specifies the type of values, which may be
either 'int', 'uint', or 'utf8'. Besides valid values of the selected
datatype, values may also be null.

The encoded buffer starts with a LEB128-encoded signed integer, the
repetition count. The interpretation of the following values depends on this
repetition count:
  - If this number is a positive value n, the next value in the buffer
    (encoded as the specified datatype) is repeated n times in the sequence.
  - If the repetition count is a negative value -n, then the next n values
    (encoded as the specified datatype) in the buffer are treated as a
    literal, i.e. they appear in the sequence without any further
    interpretation or repetition.
  - If the repetition count is zero, then the next value in the buffer is a
    LEB128-encoded unsigned integer indicating the number of null values
    that appear at the current position in the sequence.

After one of these three has completed, the process repeats, starting again
with a repetition count, until we reach the end of the buffer.