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

BeginRead() public method

public BeginRead ( 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 BeginRead(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 AsyncRead ()
		{
			GZipStream cs = new GZipStream (new MemoryStream (), CompressionMode.Decompress);
			message = "AsyncRead";
			reset.Reset ();
			IAsyncResult r = cs.BeginRead (new byte[0], 0, 0, new AsyncCallback (ReadCallback), cs);
			Assert.IsNotNull (r, "IAsyncResult");
			if (!reset.WaitOne (timeout, true))
				Assert.Ignore ("Timeout");
			Assert.IsNull (message, message);
			cs.Close ();
		}