From eb0c75ea8177099039e89a4f673a56be2c4d1645 Mon Sep 17 00:00:00 2001 From: HowToDoThis Date: Thu, 12 Aug 2021 02:39:33 +0800 Subject: [PATCH] PR #579 --- src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs b/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs index 4410a081..fa012053 100644 --- a/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs +++ b/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs @@ -4,6 +4,8 @@ using System; using System.IO; using System.Security.Cryptography; +using System.Threading; +using System.Threading.Tasks; namespace ICSharpCode.SharpZipLib.Encryption { @@ -92,6 +94,13 @@ public override int Read(byte[] buffer, int offset, int count) return nBytes; } + /// + public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + var readCount = Read(buffer, offset, count); + return Task.FromResult(readCount); + } + // Read data from the underlying stream and decrypt it private int ReadAndTransform(byte[] buffer, int offset, int count) {