Skip to content

Commit

Permalink
Merge pull request #63 from itsWindows11/feature/nondisposable-async
Browse files Browse the repository at this point in the history
Added async support to `NonDisposableStreamWrapper`
  • Loading branch information
Arlodotexe authored Jun 23, 2024
2 parents 3cfa945 + ca823f0 commit 4e2c5bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Memory/NonDisposableStreamWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;

namespace OwlCore.Storage.Memory;

Expand Down Expand Up @@ -38,6 +40,14 @@ protected override void Dispose(bool disposing)
/// <inheritdoc />
public override void Write(byte[] buffer, int offset, int count) => _stream.Write(buffer, offset, count);

/// <inheritdoc />
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _stream.ReadAsync(buffer, offset, count, cancellationToken);

/// <inheritdoc />
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _stream.WriteAsync(buffer, offset, count, cancellationToken);

/// <inheritdoc />
public override bool CanRead => _stream.CanRead;

Expand Down

0 comments on commit 4e2c5bb

Please sign in to comment.