System.IO.Compression.GZipStream.BeginWrite C# (CSharp) Method

BeginWrite() public method

public BeginWrite ( byte array, int offset, int count, AsyncCallback asyncCallback, object asyncState ) : IAsyncResult
array byte
offset int
count int
asyncCallback AsyncCallback
asyncState object
return IAsyncResult
        public override IAsyncResult BeginWrite(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) =>
            TaskToApm.Begin(WriteAsync(array, offset, count, CancellationToken.None), asyncCallback, asyncState);

Usage Example

Exemplo n.º 1
0
		public void AsyncWrite ()
		{
			GZipStream cs = new GZipStream (new MemoryStream (), CompressionMode.Compress);
			message = "AsyncWrite";
			reset.Reset ();
			IAsyncResult r = cs.BeginWrite (new byte[0], 0, 0, new AsyncCallback (WriteCallback), cs);
			Assert.IsNotNull (r, "IAsyncResult");
			if (!reset.WaitOne (timeout, true))
				Assert.Ignore ("Timeout");
			Assert.IsNull (message, message);
// the Close is currently buggy in Mono
//			cs.Close ();
		}