Skip to content

Commit

Permalink
fix(tar): enable async overrides on net6 (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel authored Dec 16, 2022
1 parent 58b5c4e commit c4009fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ICSharpCode.SharpZipLib/Tar/TarBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
{
if (isAsync)
{
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
await outputStream.DisposeAsync().ConfigureAwait(false);
#else
outputStream.Dispose();
Expand All @@ -660,7 +660,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
{
if (isAsync)
{
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
await inputStream.DisposeAsync().ConfigureAwait(false);
#else
inputStream.Dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/ICSharpCode.SharpZipLib/Tar/TarHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public static string ParseName(ReadOnlySpan<byte> header, Encoding encoding)
}
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
var value = encoding.GetString(header.Slice(0, count));
#else
var value = encoding.GetString(header.ToArray(), 0, count);
Expand Down
4 changes: 2 additions & 2 deletions src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
return ReadAsync(buffer.AsMemory().Slice(offset, count), cancellationToken, true).AsTask();
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
/// <summary>
/// Reads bytes from the current tar archive entry.
///
Expand Down Expand Up @@ -372,7 +372,7 @@ protected override void Dispose(bool disposing)
}
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
/// <summary>
/// Closes this stream. Calls the TarBuffer's close() method.
/// The underlying stream is closed by the TarBuffer.
Expand Down

0 comments on commit c4009fd

Please sign in to comment.