public static void encodeRLP(
      final Transaction transaction,
      final RLPOutput rlpOutput,
      final EncodingContext encodingContext) {
    final TransactionType transactionType = getTransactionType(transaction);

    Bytes opaqueBytes = encodeOpaqueBytes(transaction, encodingContext);
    encodeRLP(transactionType, opaqueBytes, rlpOutput);
  }
Encodes a transaction into RLP format.

@param transaction the transaction to encode
@param rlpOutput the RLP output stream
@param encodingContext the encoding context
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionEncoder.java