finish() {
    if (this.state === "literal") this.literal.push(this.lastValue)
    // Don't write anything if the only values we have seen are nulls
    if (this.state !== "nulls" || this.offset > 0) this.flush()
  }
Flushes any unwritten data to the buffer. Call this before reading from
the buffer constructed by this Encoder.