System.IO.FileStream.InternalCreate C# (CSharp) Method

InternalCreate() static private method

static private InternalCreate ( string path, int bufferSize = DefaultBufferSize, bool useAsync = DefaultIsAsync ) : FileStream
path string
bufferSize int
useAsync bool
return FileStream
        internal static FileStream InternalCreate(string path, int bufferSize = DefaultBufferSize, bool useAsync = DefaultIsAsync)
        {
            return new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, bufferSize, useAsync);
        }

Usage Example

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);
        }
All Usage Examples Of System.IO.FileStream::InternalCreate