CreateFileStream() public static méthode

public static CreateFileStream ( string path, bool write, bool append ) : Stream
path string
write bool
append bool
Résultat Stream
Exemple #1
0
        public StreamWriter(string path, bool append, Encoding encoding, int bufferSize)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath);
            }
            if (bufferSize <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum);
            }

            Stream stream = FileStreamHelpers.CreateFileStream(path, write: true, append: append);

            Init(stream, encoding, bufferSize, shouldLeaveOpen: false);
        }