Skip to content

Commit b3ce045

Browse files
committed
Implement ReadAsync in ZipAESStream, extra simple version
1 parent 78bc308 commit b3ce045

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ICSharpCode.SharpZipLib/Encryption/ZipAESStream.cs

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.IO;
33
using System.Security.Cryptography;
4+
using System.Threading;
5+
using System.Threading.Tasks;
46
using ICSharpCode.SharpZipLib.Core;
57

68
namespace ICSharpCode.SharpZipLib.Encryption
@@ -90,6 +92,13 @@ public override int Read(byte[] buffer, int offset, int count)
9092
return nBytes;
9193
}
9294

95+
/// <inheritdoc/>
96+
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
97+
{
98+
var readCount = Read(buffer, offset, count);
99+
return Task.FromResult(readCount);
100+
}
101+
93102
// Read data from the underlying stream and decrypt it
94103
private int ReadAndTransform(byte[] buffer, int offset, int count)
95104
{

0 commit comments

Comments
 (0)