InternalCreate() static private method

static private InternalCreate ( string path, int bufferSize = DefaultBufferSize, bool useAsync = DefaultIsAsync ) : FileStream
path string
bufferSize int
useAsync bool
return FileStream
Example #1
0
        public static void WriteAllLines(String path, IEnumerable <String> contents, Encoding encoding)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (contents == null)
            {
                throw new ArgumentNullException("contents");
            }
            if (encoding == null)
            {
                throw new ArgumentNullException("encoding");
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath, "path");
            }
            Contract.EndContractBlock();

            Stream stream = FileStream.InternalCreate(path, useAsync: false);

            InternalWriteAllLines(new StreamWriter(stream, encoding), contents);
        }
Example #2
0
        public StreamWriter CreateText()
        {
            Stream stream = FileStream.InternalCreate(FullPath);

            return(new StreamWriter(stream));
        }