InternalAppend() static private method

static private InternalAppend ( string path, int bufferSize = DefaultBufferSize, bool useAsync = DefaultIsAsync ) : FileStream
path string
bufferSize int
useAsync bool
return FileStream
Exemplo n.º 1
0
        private static void InternalAppendAllText(String path, String contents, Encoding encoding)
        {
            Contract.Requires(path != null);
            Contract.Requires(encoding != null);
            Contract.Requires(path.Length > 0);

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

            using (StreamWriter sw = new StreamWriter(stream, encoding))
                sw.Write(contents);
        }
Exemplo n.º 2
0
        public static StreamWriter AppendText(String path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            Contract.EndContractBlock();

            Stream stream = FileStream.InternalAppend(path);

            return(new StreamWriter(stream));
        }
Exemplo n.º 3
0
        public static void AppendAllLines(String path, IEnumerable <String> contents)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (contents == null)
            {
                throw new ArgumentNullException("contents");
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath);
            }
            Contract.EndContractBlock();

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

            InternalWriteAllLines(new StreamWriter(stream, UTF8NoBOM), contents);
        }
Exemplo n.º 4
0
        public StreamWriter AppendText()
        {
            Stream stream = FileStream.InternalAppend(FullPath);

            return(new StreamWriter(stream));
        }