class RedisCommandExecutor implements CommandExecutor {

  public void execute(final ByteCommand command, final byte[]... args)
      throws ConnectionException, IOException {
    connection.open();
    final RedisStreamWriter streamWriter = connection.getStreamWriter();
    streamWriter.write(RedisBytes.ASTERISK_BYTE);
    streamWriter.write(args.length + 1);// 1 comes from set
    streamWriter.writeNewLine();
    streamWriter.write(RedisBytes.DOLLAR_BYTE);
    streamWriter.write(command.getBytes().length);
    streamWriter.writeNewLine();
    streamWriter.write(command.getBytes());
    streamWriter.writeNewLine();

    for (final byte[] arg : args) {
      streamWriter.write(RedisBytes.DOLLAR_BYTE);
      streamWriter.write(arg.length);
      streamWriter.writeNewLine();
      streamWriter.write(arg);
      streamWriter.writeNewLine();
    }
    streamWriter.flush();
  }

  public  RedisCommandExecutor(final Connection connection);

}