public void Print(FileInfo filename, Encoding fileEncoding, IContentParameters parameters)
        {
            if (filename == null)
            {
                throw new ArgumentNullException("filename cannot be null", "filename");
            }

            if (fileEncoding == null)
            {
                throw new ArgumentNullException("encoding", "encoding cannot be null");
            }

            if (parameters == null)
            {
                throw new ArgumentNullException("parameters", "parameters cannot be null");
            }

            this.CurrentEncoding = fileEncoding;

            IFileContentReader fileReader = new FileContentReader(filename.Name);

            var readedBytes = fileReader.ReadAllAsByte();

            IContentReplacer replacer = new ContentReplacer(parameters, fileEncoding);

            var result = replacer.Replace(readedBytes);

            if (result != null)
            {
                Print(result);
            }
        }
        /// <summary>
        /// Writes contents of toPrint to designated Port based on parameters
        /// </summary>
        /// <param name="filename">Payload path</param>
        /// <param name="fileEncoding">Read encoding</param>
        /// <param name="parameters">Parameters</param>
        public void Print(string filename, Encoding fileEncoding, IContentParameters parameters)
        {
            if (string.IsNullOrEmpty(filename))
            {
                throw new ArgumentException("filename cannot be empty or null", "filename");
            }

            if (fileEncoding == null)
            {
                throw new ArgumentNullException("encoding", "encoding cannot be null");
            }

            if (parameters == null)
            {
                throw new ArgumentNullException("parameters", "parameters cannot be null");
            }

            this.CurrentEncoding = fileEncoding;

            var readedBytes = fileReader.ReadAllAsByte(filename);

            IContentReplacer replacer = new ContentReplacer(parameters);

            var result = replacer.Replace(readedBytes);

            if (result != null)
            {
                Print(result);
            }
        }
        public void Print(byte[] toPrint, IContentParameters parameters)
        {
            if (toPrint == null)
            {
                throw new ArgumentNullException("toPrint", "toPrint cannot be null");
            }
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters", "parameters cannot be null");
            }

            IContentReplacer replacer = new ContentReplacer(parameters);

            var result = replacer.Replace(toPrint);

            if (result != null)
            {
                Print(result);
            }
        }
        public void Print(string toPrint, IContentParameters parameters)
        {
            IContentReplacer replacer = new ContentReplacer(parameters);

            Print(replacer.Replace(CurrentEncoding.GetBytes(toPrint)));
        }