Skip to content

Commit ace6983

Browse files
committed
Implement ReadAsync in ZipAESStream, extra simple version
1 parent b8fcd53 commit ace6983

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
using ICSharpCode.SharpZipLib.Zip;
68

@@ -91,6 +93,13 @@ public override int Read(byte[] buffer, int offset, int count)
9193
return nBytes;
9294
}
9395

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

0 commit comments

Comments
 (0)