Skip to content

Commit

Permalink
Fix ref files from System.IO.Compression and System.IO.Compression.Br…
Browse files Browse the repository at this point in the history
…otli with autogenerated file using GenAPI (#112440)

* Fix System.IO.Compression ref file.
* Fix System.IO.Compression.Brotli ref file.
* Add missing default CancellationToken argument value to WriteAsync in DeflateStream, remove unnecessary cast in ReadAsync.
* Omit ZLibException as intended in the CompatibilitySuppressions.xml
* Remove invalid test files
* Add GenApiExcludeApiList and an API exclusions txt file
  • Loading branch information
carlossanlop authored Feb 12, 2025
1 parent fc7fcb7 commit 8c3506a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

namespace System.IO.Compression
{
public sealed class BrotliCompressionOptions
public sealed partial class BrotliCompressionOptions
{
public int Quality { get; set; }
public BrotliCompressionOptions() { }
public int Quality { get { throw null; } set { } }
}
public partial struct BrotliDecoder : System.IDisposable
{
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,19 @@ public enum ZipArchiveMode
Create = 1,
Update = 2,
}
public sealed class ZLibCompressionOptions
public sealed partial class ZLibCompressionOptions
{
public int CompressionLevel { get; set; }
public ZLibCompressionStrategy CompressionStrategy { get; set; }
public ZLibCompressionOptions() { }
public int CompressionLevel { get { throw null; } set { } }
public System.IO.Compression.ZLibCompressionStrategy CompressionStrategy { get { throw null; } set { } }
}
public enum ZLibCompressionStrategy
{
Default = 0,
Filtered = 1,
HuffmanOnly = 2,
RunLengthEncoding = 3,
Fixed = 4
Fixed = 4,
}
public sealed partial class ZLibStream : System.IO.Stream
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
T:System.IO.Compression.ZLibException

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi;$(NetCoreAppCurrent)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
<GenAPIExcludeApiList>ReferenceAssemblyExclusions.txt</GenAPIExcludeApiList>
</PropertyGroup>

<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
return ReadAsyncMemory(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
}

public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default(CancellationToken))
public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
{
if (GetType() != typeof(DeflateStream))
{
Expand Down Expand Up @@ -813,7 +813,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati
return WriteAsyncMemory(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken).AsTask();
}

public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
{
if (GetType() != typeof(DeflateStream))
{
Expand Down

0 comments on commit 8c3506a

Please sign in to comment.