private void writeOutput(final BftExtraData bftExtraDataOutput) {
      if (rlpTargetFile != null) {
        final Path targetPath = rlpTargetFile.toPath();

        try (final BufferedWriter fileWriter = Files.newBufferedWriter(targetPath, UTF_8)) {
          fileWriter.write(bftExtraDataOutput.getValidators().toString());
        } catch (final IOException e) {
          throw new ParameterException(
              spec.commandLine(),
              "An error occurred while trying to write the validator list. " + e.getMessage());
        }
      } else {
        parentCommand.out.println(bftExtraDataOutput.getValidators().toString());
      }
    }
write the decoded result to stdout or a file if the option is specified

@param bftExtraDataOutput the BFT extra data output to write to file or stdout
app/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java