mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Resolve CA1819
This commit is contained in:
@@ -111,7 +111,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
|||||||
dotnet_diagnostic.ca1031.severity = silent
|
dotnet_diagnostic.ca1031.severity = silent
|
||||||
|
|
||||||
# TODO - one at a time
|
# TODO - one at a time
|
||||||
dotnet_diagnostic.ca1819.severity = silent
|
|
||||||
dotnet_diagnostic.ca1812.severity = silent
|
dotnet_diagnostic.ca1812.severity = silent
|
||||||
dotnet_diagnostic.ca1823.severity = silent
|
dotnet_diagnostic.ca1823.severity = silent
|
||||||
dotnet_diagnostic.ca2000.severity = silent
|
dotnet_diagnostic.ca2000.severity = silent
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ namespace ArchiSteamFarm {
|
|||||||
ArchiLogger.LogGenericWarningException(e);
|
ArchiLogger.LogGenericWarningException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryStream memoryStream = new(response.Content);
|
MemoryStream memoryStream = new(response.Content as byte[] ?? response.Content.ToArray());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK
|
||||||
|
|||||||
@@ -20,19 +20,22 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
|
||||||
namespace ArchiSteamFarm.Web {
|
namespace ArchiSteamFarm.Web {
|
||||||
public sealed class BinaryResponse : BasicResponse {
|
public sealed class BinaryResponse : BasicResponse {
|
||||||
[PublicAPI]
|
[PublicAPI]
|
||||||
public byte[] Content { get; }
|
public IReadOnlyCollection<byte> Content => Bytes;
|
||||||
|
|
||||||
public BinaryResponse(BasicResponse basicResponse, byte[] content) : base(basicResponse) {
|
private readonly byte[] Bytes;
|
||||||
|
|
||||||
|
public BinaryResponse(BasicResponse basicResponse, byte[] bytes) : base(basicResponse) {
|
||||||
if (basicResponse == null) {
|
if (basicResponse == null) {
|
||||||
throw new ArgumentNullException(nameof(basicResponse));
|
throw new ArgumentNullException(nameof(basicResponse));
|
||||||
}
|
}
|
||||||
|
|
||||||
Content = content ?? throw new ArgumentNullException(nameof(content));
|
Bytes = bytes ?? throw new ArgumentNullException(nameof(bytes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user