private static int readLongSize(
      final LongUnaryOperator byteGetter,
      final long sizeOfRlpEncodedByteString,
      final long item,
      final int sizeLength) {
    // We will read sizeLength bytes from item + 1. There must be enough bytes for this or the input
    // is corrupted.
    if (sizeOfRlpEncodedByteString - (item + 1) < sizeLength) {
      throw new CorruptedRLPInputException(
          String.format(
              "Invalid RLP item: value of size %d has not enough bytes to read the %d "
                  + "bytes payload size",
              sizeOfRlpEncodedByteString, sizeLength));
    }

    // That size (which is at least 1 byte by construction) shouldn't have leading zeros.
    if (byteGetter.applyAsLong(item + 1) == 0) {
      throw new MalformedRLPInputException("Malformed RLP item: size of payload has leading zeros");
    }

    final int res = RLPDecodingHelpers.extractSizeFromLongItem(byteGetter, item + 1, sizeLength);

    // We should not have had the size written separately if it was less than 56 bytes long.
    if (res < 56) {
      throw new MalformedRLPInputException(
          String.format("Malformed RLP item: written as a long item, but size %d < 56 bytes", res));
    }

    return res;
  }
The size of the item payload for a "long" item, given the length in bytes of the said size.
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/RLPDecodingHelpers.java