mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Resolve CA1819
This commit is contained in:
parent
90ff43dc98
commit
804008a5d1
3 changed files with 7 additions and 5 deletions
|
@ -111,7 +111,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
|||
dotnet_diagnostic.ca1031.severity = silent
|
||||
|
||||
# TODO - one at a time
|
||||
dotnet_diagnostic.ca1819.severity = silent
|
||||
dotnet_diagnostic.ca1812.severity = silent
|
||||
dotnet_diagnostic.ca1823.severity = silent
|
||||
dotnet_diagnostic.ca2000.severity = silent
|
||||
|
|
|
@ -347,7 +347,7 @@ namespace ArchiSteamFarm {
|
|||
ArchiLogger.LogGenericWarningException(e);
|
||||
}
|
||||
|
||||
MemoryStream memoryStream = new(response.Content);
|
||||
MemoryStream memoryStream = new(response.Content as byte[] ?? response.Content.ToArray());
|
||||
|
||||
try {
|
||||
#if NETFRAMEWORK
|
||||
|
|
|
@ -20,19 +20,22 @@
|
|||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace ArchiSteamFarm.Web {
|
||||
public sealed class BinaryResponse : BasicResponse {
|
||||
[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) {
|
||||
throw new ArgumentNullException(nameof(basicResponse));
|
||||
}
|
||||
|
||||
Content = content ?? throw new ArgumentNullException(nameof(content));
|
||||
Bytes = bytes ?? throw new ArgumentNullException(nameof(bytes));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue