From ace6983e6eae9ebbc9ebb3ad5d2128af29b7274f Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Sun, 14 Feb 2021 22:01:22 +0000 Subject: [PATCH] Implement ReadAsync in ZipAESStream, extra simple version --- 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 4bf01300b..80ce0b4ab 100644 --- a/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs +++ b/src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs @@ -1,6 +1,8 @@ using System; using System.IO; using System.Security.Cryptography; +using System.Threading; +using System.Threading.Tasks; using ICSharpCode.SharpZipLib.Core; using ICSharpCode.SharpZipLib.Zip; @@ -91,6 +93,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) {