public int encodedSize() {
    checkState(stackSize == 1, "A list has been entered (startList()) but not left (endList())");
    return payloadSizes[0];
  }
Computes the final encoded data size.

@return The size of the RLP-encoded data written to this output.
@throws IllegalStateException if some opened list haven't been closed (the output is not valid
    as is).
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/AbstractRLPOutput.java