System.Diagnostics.Process.ProcessAsyncReader.AddInput C# (CSharp) Method

AddInput() public method

public AddInput ( ) : void
return void
			public void AddInput ()
			{
				lock (this) {
					int nread = stream.Read (buffer, 0, buffer.Length);
					if (nread == 0) {
						completed = true;
						if (wait_handle != null)
							wait_handle.Set ();
						FlushLast ();
						return;
					}

					try {
						sb.Append (Encoding.Default.GetString (buffer, 0, nread));
					} catch {
						// Just in case the encoding fails...
						for (int i = 0; i < nread; i++) {
							sb.Append ((char) buffer [i]);
						}
					}

					Flush (false);
					ReadHandler.BeginInvoke (null, this);
				}
			}