Use u8 in more places (#69995)
authorStephen Toub <stoub@microsoft.com>
Tue, 7 Jun 2022 17:42:23 +0000 (13:42 -0400)
committerGitHub <noreply@github.com>
Tue, 7 Jun 2022 17:42:23 +0000 (13:42 -0400)
commit0c4ee9e749167a2185f59b4a16c8a5c62e0ec5df
tree4a47ce3660a02cee6c30aa919a82550fccab7379
parent9f654ce129ff05f27ef7844af6a775b883d2d3e8
Use u8 in more places (#69995)

* Use u8 in more places

Primarily replacing Encoding.UTF8/ASCII.GetBytes("literal") with "literal"u8.ToArray()

* Address PR feedback (and fix some vars)
138 files changed:
src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs
src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAKeyFileTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAKeyPemTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSATestData.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.LimitedPrivate.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAKeyFileTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAKeyPemTests.cs
src/libraries/Common/tests/Tests/System/StringTests.cs
src/libraries/System.Diagnostics.Process/tests/RemotelyInvokable.cs
src/libraries/System.DirectoryServices.Protocols/tests/DirectoryServicesProtocolsTests.cs
src/libraries/System.Drawing.Common/tests/ImageTests.cs
src/libraries/System.Formats.Asn1/tests/Reader/ReadGeneralizedTime.cs
src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarHeader.Write.cs
src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Unix.cs
src/libraries/System.IO.Compression/tests/ZipArchive/zip_UpdateTests.cs
src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs
src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs
src/libraries/System.IO.FileSystem/tests/FileStream/DevicesPipesAndSockets.cs
src/libraries/System.IO.FileSystem/tests/FileStream/ctor_str_fm.cs
src/libraries/System.IO.Hashing/tests/Crc32Tests.cs
src/libraries/System.IO.Hashing/tests/Crc64Tests.cs
src/libraries/System.IO.Hashing/tests/XxHash32Tests.007.cs
src/libraries/System.IO.Hashing/tests/XxHash32Tests.cs
src/libraries/System.IO.Hashing/tests/XxHash32Tests.f00d.cs
src/libraries/System.IO.Hashing/tests/XxHash64Tests.007.cs
src/libraries/System.IO.Hashing/tests/XxHash64Tests.cs
src/libraries/System.IO.Hashing/tests/XxHash64Tests.f00d.cs
src/libraries/System.IO.Pipelines/tests/PipeReaderCopyToAsyncTests.cs
src/libraries/System.IO.Pipelines/tests/PipeReaderReadAtLeastAsyncTests.cs
src/libraries/System.IO.Pipelines/tests/PipeReaderStreamTests.nonnetstandard.cs
src/libraries/System.IO.Pipelines/tests/PipeReaderWriterFacts.cs
src/libraries/System.IO.Pipelines/tests/PipeWriterCopyToAsyncTests.cs
src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs
src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs
src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs
src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs
src/libraries/System.IO.Pipelines/tests/SequencePipeReaderTests.cs
src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs
src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs
src/libraries/System.IO.Pipelines/tests/UnflushedBytesTests.cs
src/libraries/System.Memory.Data/tests/BinaryDataTests.cs
src/libraries/System.Memory/tests/Base64/Base64DecoderUnitTests.cs
src/libraries/System.Memory/tests/BuffersExtensions/BuffersExtensionsTests.cs
src/libraries/System.Memory/tests/EncodingExtensions/EncodingExtensionsTests.cs
src/libraries/System.Memory/tests/ReadOnlyBuffer/ReadOnlySequenceTests.Common.byte.cs
src/libraries/System.Memory/tests/SequenceReader/ReadTo.cs
src/libraries/System.Memory/tests/SequenceReader/SkipDelimiter.cs
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/BidirectionStreamingTest.cs
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/TrailingHeadersTest.cs
src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/WinHttpResponseStreamTest.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HPackTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http2.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpContentTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/MultipartContentTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamConformanceTests.cs
src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
src/libraries/System.Net.Http/tests/UnitTests/Headers/MultipartContentTest.cs
src/libraries/System.Net.Http/tests/UnitTests/MockContent.cs
src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs
src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpResponseStreamAsyncResult.cs
src/libraries/System.Net.HttpListener/tests/HttpListenerAuthenticationTests.cs
src/libraries/System.Net.HttpListener/tests/HttpListenerContextTests.cs
src/libraries/System.Net.HttpListener/tests/HttpListenerResponseTests.cs
src/libraries/System.Net.HttpListener/tests/HttpResponseStreamTests.cs
src/libraries/System.Net.Mail/src/System/Net/Mime/EncodedStreamFactory.cs
src/libraries/System.Net.Mail/tests/Functional/LoopbackSmtpServer.cs
src/libraries/System.Net.Mail/tests/Unit/QuotedPrintableStreamTest.cs
src/libraries/System.Net.Ping/tests/FunctionalTests/TestSettings.cs
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs
src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs
src/libraries/System.Net.Quic/tests/FunctionalTests/QuicTestBase.cs
src/libraries/System.Net.Requests/tests/FtpWebRequestTest.cs
src/libraries/System.Net.Security/src/System/Net/Security/SslApplicationProtocol.cs
src/libraries/System.Net.Security/tests/EnterpriseTests/NegotiateStreamLoopbackTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/NegotiateStreamInvalidOperationTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/NegotiateStreamKerberosTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/NegotiateStreamStreamToStreamTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamAllowRenegotiationTests.cs
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamNetworkStreamTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamStreamToStreamTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/TestHelper.cs
src/libraries/System.Net.Security/tests/UnitTests/SslApplicationProtocolTests.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs
src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs
src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs
src/libraries/System.Private.DataContractSerialization/src/System/Xml/EncodingStreamWrapper.cs
src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/NamespaceHandlingTests.cs
src/libraries/System.Private.Xml/tests/XmlNodeReader/System.Xml.XmlNodeReader.Tests/XmlNodeReaderReadTests.cs
src/libraries/System.Private.Xml/tests/XmlResolver/System.Xml.XmlResolver.Tests/XmlPreloadedResolverAddRemoveTests.cs
src/libraries/System.Private.Xml/tests/XmlResolver/System.Xml.XmlResolver.Tests/XmlPreloadedResolverGetEntity.cs
src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs
src/libraries/System.Reflection.Metadata/tests/PortableExecutable/PEBinaryReaderTests.cs
src/libraries/System.Reflection.Metadata/tests/Utilities/BlobReaderTests.cs
src/libraries/System.Reflection.Metadata/tests/Utilities/MemoryBlockTests.cs
src/libraries/System.Runtime.Extensions/tests/System/Convert.ToBase64CharArray.cs
src/libraries/System.Runtime.Extensions/tests/System/Net/WebUtility.cs
src/libraries/System.Runtime.Serialization.Xml/tests/SerializationTestTypes/SampleTypes.cs
src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs
src/libraries/System.Security.Cryptography.Pkcs/tests/Rfc3161/TimestampRequestTests.cs
src/libraries/System.Security.Cryptography.Pkcs/tests/Rfc3161/TimestampTokenTestData.cs
src/libraries/System.Security.Cryptography.X509Certificates/tests/PublicKeyTests.cs
src/libraries/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs
src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/AppleCertificatePal.Pem.iOS.cs
src/libraries/System.Security.Cryptography/tests/Base64TransformsTests.cs
src/libraries/System.Security.Cryptography/tests/CryptoStream.cs
src/libraries/System.Security.Cryptography/tests/Rfc2898OneShotTests.cs
src/libraries/System.Security.Cryptography/tests/TripleDesTests.cs
src/libraries/System.Text.Encoding.Extensions/tests/Fallback.cs
src/libraries/System.Text.Encodings.Web/tests/TextEncoderTests.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs
src/libraries/System.Text.Json/tests/Common/ConstructorTests/ConstructorTests.Stream.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonElementWriteTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/ParseTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonReaderStateAndOptionsTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/NewtonsoftTests/CustomObjectConverterTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Array.ReadTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Null.ReadTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/SpanTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Stream.ReadTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Value.WriteTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/WriteValueTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.MultiSegment.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.ValueTextEquals.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonReaderTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.WriteRaw.cs
src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs