private void validateCurrentItem() {
    // Validate that a single byte SHORT_ELEMENT payload is not <= 0x7F. If it is, it should have
    // been written as a BYTE_ELEMENT.
    if (currentKind == RLPDecodingHelpers.Kind.SHORT_ELEMENT
        && currentPayloadSize == 1
        && currentPayloadOffset < size
        && (payloadByte(0) & 0xFF) <= 0x7F) {
      throwMalformed(
          "Malformed RLP item: single byte value 0x%s should have been "
              + "written without a prefix",
          hex(currentPayloadOffset, currentPayloadOffset + 1));
    }

    if (currentPayloadSize > 0 && currentPayloadOffset >= size) {
      throw corrupted(
          "Invalid RLP item: payload should start at offset %d but input has only " + "%d bytes",
          currentPayloadOffset, size);
    }
    if (size - currentPayloadOffset < currentPayloadSize) {
      throw corrupted(
          "Invalid RLP item: payload starting at byte %d should be %d bytes long, but input "
              + "has only %d bytes from that offset",
          currentPayloadOffset, currentPayloadSize, size - currentPayloadOffset);
    }
  }
Sets the input to the item provided (an offset to the beginning of an item) and check this is
valid.

@param item the value to which the current item is to be set.
ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/AbstractRLPInput.java