int getEncodedSize() {
      final long encodedSize = elementEnd() - elementStart + 1;
      try {
        return Math.toIntExact(encodedSize);
      } catch (final ArithmeticException e) {
        throw new RLPException(
            String.format(
                "RLP item exceeds max supported size of %d: %d", Integer.MAX_VALUE, encodedSize),
            e);
      }
    }
The size of the byte string holding the rlp-encoded value and metadata

@return the size of the byte string holding the rlp-encoded value and metadata
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/RLPDecodingHelpers.java