using System.IO;
using System.Text;

namespace csharp_clients
{
    public static class Extensions
    {
        public static Stream ToStream(this string str, Encoding enc = null)
        {
            enc = enc ?? Encoding.UTF8;
            return new MemoryStream(enc.GetBytes(str ?? ""));
        }
    }
}
