static int elementSize(final Bytes value) {
    if (isSingleRLPByte(value)) return 1;

    if (isShortElement(value)) return 1 + value.size();

    return 1 + sizeLength(value.size()) + value.size();
  }
The encoded size of the provided value.
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/RLPEncodingHelpers.java