Exemple #1
0
		public override Task<string> ReadToEndAsync ()
		{
			CheckState ();

			DecoupledTask<string> res;
			async_task = res = new DecoupledTask<string> (ReadToEndAsyncCore ());
			return res.Task;
		}
Exemple #2
0
		public override Task WriteLineAsync (string value)
		{
			if (value == null)
				return WriteLineAsync ();

			CheckState ();
			DecoupledTask res;			
			async_task = res = new DecoupledTask (WriteAsyncCore (value, true));
			return res.Task;
		}
Exemple #3
0
		public override Task<int> ReadBlockAsync (char[] buffer, int index, int count)
		{
			if (buffer == null)
				throw new ArgumentNullException ("buffer");
			if (index < 0)
				throw new ArgumentOutOfRangeException ("index", "< 0");
			if (count < 0)
				throw new ArgumentOutOfRangeException ("count", "< 0");
			// re-ordered to avoid possible integer overflow
			if (index > buffer.Length - count)
				throw new ArgumentException ("index + count > buffer.Length");

			CheckState ();

			DecoupledTask<int> res;
			async_task = res = new DecoupledTask<int> (ReadAsyncCore (buffer, index, count));
			return res.Task;
		}
Exemple #4
0
		public override Task WriteLineAsync ()
		{
			CheckState ();

			DecoupledTask res;
			async_task = res = new DecoupledTask (WriteAsyncCore (CoreNewLine, 0, CoreNewLine.Length));
			return res.Task;
		}
Exemple #5
0
		public override Task WriteLineAsync (char value)
		{
			CheckState ();
			DecoupledTask res;
			async_task = res = new DecoupledTask (WriteLineAsyncCore (value));
			return res.Task;
		}
Exemple #6
0
		public override Task WriteAsync (string value)
		{
			CheckState ();

			if (value == null)
				return TaskConstants.Finished;

			DecoupledTask res;			
			async_task = res = new DecoupledTask (WriteAsyncCore (value, false));
			return res.Task;
		}
Exemple #7
0
		public override Task WriteAsync (char[] buffer, int index, int count)
		{
			CheckState ();
			if (buffer == null)
				return TaskConstants.Finished;

			DecoupledTask res;
			async_task = res = new DecoupledTask (WriteAsyncCore (buffer, index, count));
			return res.Task;
		}
Exemple #8
0
		public override Task FlushAsync ()
		{
			CheckState ();
			DecoupledTask res;
			async_task = res = new DecoupledTask (FlushCoreAsync ());
			return res.Task;
		}
Exemple #9
0
		public override Task WriteLineAsync (string value)
		{
			CheckState ();
			DecoupledTask res;			
			async_task = res = new DecoupledTask (base.WriteLineAsync (value));
			return res.Task;
		}
Exemple #10
0
		public override Task WriteLineAsync (char[] buffer, int index, int count)
		{
			CheckState ();
			DecoupledTask res;
			async_task = res = new DecoupledTask (base.WriteLineAsync (buffer, index, count));
			return res.Task;
		}