From b3ce0459a0f7711a1e7dae63e470a451fd9009a5 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 4f649e8a9..6cecb457d 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; namespace ICSharpCode.SharpZipLib.Encryption @@ -90,6 +92,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) {