Example #1
0
 internal StreamWriter(string path, bool append, Encoding encoding, int bufferSize, bool checkHost)
     : base((IFormatProvider)null)
 {
     if (path == null)
     {
         throw new ArgumentNullException("path");
     }
     if (encoding == null)
     {
         throw new ArgumentNullException("encoding");
     }
     if (path.Length == 0)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"));
     }
     if (bufferSize <= 0)
     {
         throw new ArgumentOutOfRangeException("bufferSize", Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"));
     }
     this.Init(StreamWriter.CreateFile(path, append, checkHost), encoding, bufferSize, false);
 }