WriteAsyncInternal() private static method

private static WriteAsyncInternal ( StreamWriter _this, char value, char charBuffer, int charPos, int charLen, char coreNewLine, bool autoFlush, bool appendNewLine ) : System.Threading.Tasks.Task
_this StreamWriter
value char
charBuffer char
charPos int
charLen int
coreNewLine char
autoFlush bool
appendNewLine bool
return System.Threading.Tasks.Task
Example #1
0
        public override Task WriteLineAsync(char[] buffer, int index, int count)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer", Environment.GetResourceString("ArgumentNull_Buffer"));
            }
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
            }
            if (count < 0)
            {
                throw new ArgumentOutOfRangeException("count", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"));
            }
            if (buffer.Length - index < count)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
            }
            if (this.GetType() != typeof(StreamWriter))
            {
                return(base.WriteLineAsync(buffer, index, count));
            }
            if (this.stream == null)
            {
                __Error.WriterClosed();
            }
            this.CheckAsyncTaskInProgress();
            Task task = StreamWriter.WriteAsyncInternal(this, buffer, index, count, this.charBuffer, this.charPos, this.charLen, this.CoreNewLine, this.autoFlush, true);

            this._asyncWriteTask = task;
            return(task);
        }
Example #2
0
        public override Task WriteLineAsync(string value)
        {
            if (this.GetType() != typeof(StreamWriter))
            {
                return(base.WriteLineAsync(value));
            }
            if (this.stream == null)
            {
                __Error.WriterClosed();
            }
            this.CheckAsyncTaskInProgress();
            Task task = StreamWriter.WriteAsyncInternal(this, value, this.charBuffer, this.charPos, this.charLen, this.CoreNewLine, this.autoFlush, true);

            this._asyncWriteTask = task;
            return(task);
        }