3 overrides of GetBytes
System.Private.CoreLib (3)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (1)
315public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (1)
227public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (1)
361public override unsafe int GetBytes(ReadOnlySpan<char> chars, Span<byte> bytes)
127 references to GetBytes
Aspire.Dashboard (1)
src\Shared\CompareHelpers.cs (1)
29var encodedByteCount = Encoding.UTF8.GetBytes(requestKey, requestBytesSpan);
Aspire.Hosting (1)
src\Shared\CompareHelpers.cs (1)
29var encodedByteCount = Encoding.UTF8.GetBytes(requestKey, requestBytesSpan);
dotnet (2)
Commands\Test\MTP\IPC\Serializers\BaseSerializer.cs (2)
51Encoding.UTF8.GetBytes(str, bytes); 66Encoding.UTF8.GetBytes(str, bytes);
ILAssembler (1)
GrammarVisitor.cs (1)
3130Encoding.UTF8.GetBytes(str, utf8Bytes);
ILCompiler.Compiler (7)
Compiler\ObjectWriter\CodeView\CodeViewSymbolsBuilder.cs (1)
419Encoding.UTF8.GetBytes(value, _bufferWriter.GetSpan(byteCount));
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (1)
458Encoding.UTF8.GetBytes(value, _bufferWriter.GetSpan(byteCount));
Compiler\RuntimeConfigurationRootProvider.cs (1)
118Encoding.UTF8.GetBytes(s, result);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (1)
608Encoding.UTF8.GetBytes(Name, buffer);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (2)
136Encoding.UTF8.GetBytes(value, buffer); 146Encoding.UTF8.GetBytes(value, buffer);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
86Encoding.UTF8.GetBytes(value, _buffer.AsSpan(_length));
ILCompiler.ReadyToRun (4)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (1)
608Encoding.UTF8.GetBytes(Name, buffer);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionWriter.cs (2)
136Encoding.UTF8.GetBytes(value, buffer); 146Encoding.UTF8.GetBytes(value, buffer);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (1)
86Encoding.UTF8.GetBytes(value, _buffer.AsSpan(_length));
Microsoft.AspNetCore.Antiforgery (1)
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
110Encoding.UTF8.GetBytes(value.AsSpan(), target[lengthPrefixSize..]);
Microsoft.AspNetCore.Components.Endpoints (2)
Builder\ResourceCollectionUrlEndpoint.cs (1)
186var bytesWritten = Encoding.UTF8.GetBytes(value, rented);
CacheView\CacheViewKeyResolver.cs (1)
283var written = Encoding.UTF8.GetBytes(value, buffer);
Microsoft.AspNetCore.DataProtection (1)
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
110Encoding.UTF8.GetBytes(value.AsSpan(), target[lengthPrefixSize..]);
Microsoft.AspNetCore.Http.Abstractions (1)
Extensions\HttpResponseWritingExtensions.cs (1)
81var bytesWritten = encoding.GetBytes(text, destination);
Microsoft.AspNetCore.OutputCaching (1)
FormatterBinaryWriter.cs (1)
93var actual = Encoding.UTF8.GetBytes(value, AvailableBuffer);
Microsoft.AspNetCore.Server.HttpSys (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
90length = Encoding.UTF8.GetBytes(myString, buffer);
Microsoft.AspNetCore.Server.IIS (3)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
90length = Encoding.UTF8.GetBytes(myString, buffer);
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (2)
122Encoding.ASCII.GetBytes(data, dest); 203encoding.GetBytes(data, dest);
Microsoft.AspNetCore.Server.Kestrel.Core (11)
Internal\Http\DateHeaderValueManager.cs (1)
49Encoding.ASCII.GetBytes(dateValue, dateBytes.AsSpan(DatePreambleBytes.Length));
Internal\Http\Http1Connection.cs (1)
710Encoding.ASCII.GetBytes(absolutePath, pathBufferSliced);
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
90length = Encoding.UTF8.GetBytes(myString, buffer);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
480int written = valueEncoding.GetBytes(value, destination); 573int written = valueEncoding.GetBytes(values[0], destination); 581written = valueEncoding.GetBytes(values[i], destination);
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackEncoder.cs (3)
203int written = valueEncoding.GetBytes(s, buffer); 278int written = valueEncoding.GetBytes(values[0], buffer); 286written = valueEncoding.GetBytes(values[i], buffer);
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (2)
122Encoding.ASCII.GetBytes(data, dest); 203encoding.GetBytes(data, dest);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
90length = Encoding.UTF8.GetBytes(myString, buffer);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
90length = Encoding.UTF8.GetBytes(myString, buffer);
Microsoft.AspNetCore.WebSockets (1)
HandshakeHelpers.cs (1)
61Encoding.UTF8.GetBytes(requestKey, mergedBytes);
Microsoft.Build.Framework (1)
Coordinator\CoordinatorSettings.cs (1)
156Encoding.UTF8.GetBytes(PipeName, pipeNameBytes);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.StampedeStateT.cs (1)
598byteBuffer = byteBuffer.Slice(0, HybridCachePayload.Encoding.GetBytes(value.AsSpan(), byteBuffer));
Microsoft.JSInterop (1)
Infrastructure\DotNetDispatcher.cs (1)
226var receivedBytes = Encoding.UTF8.GetBytes(arguments, buffer);
Microsoft.ML.Tokenizers (1)
Utils\Helpers.netcoreapp.cs (1)
56=> Encoding.UTF8.GetBytes(source, destination);
Microsoft.ML.Tokenizers.Tests (1)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (1)
56=> Encoding.UTF8.GetBytes(source, destination);
Microsoft.Net.Http.Headers (1)
ContentDispositionHeaderValue.cs (1)
556var contentLength = Encoding.UTF8.GetBytes(input.AsSpan(), bufferContent);
Shared (1)
ServerSentEvents\Helpers.cs (1)
70bytesWritten = Encoding.UTF8.GetBytes(value, buffer);
System.Console (1)
System\ConsolePal.Unix.cs (1)
1134int bytesToWrite = Encoding.UTF8.GetBytes(value, data);
System.Diagnostics.Process (4)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (3)
142int bytesWritten = Encoding.UTF8.GetBytes(arr[i], data.Slice(dataOffset)); 189int keyBytes = Encoding.UTF8.GetBytes(pair.Key, data.Slice(dataOffset)); 191int valueBytes = Encoding.UTF8.GetBytes(pair.Value, data.Slice(dataOffset + keyBytes + 1));
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
55int byteCount = Encoding.UTF8.GetBytes(managed, buffer);
System.DirectoryServices.Protocols (1)
System\DirectoryServices\Protocols\common\AsnWriterExtensions.cs (1)
27stringEncoding.GetBytes(value, tmpValue);
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnWriter.Text.cs (2)
101int written = encoding.GetBytes(str, dest); 118int written = encoding.GetBytes(str, tmp);
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.String.cs (1)
149utf8Encoding.GetBytes(value, _buffer.AsSpan(_offset, length));
System.Formats.Tar (5)
System\Formats\Tar\TarHeader.Write.cs (5)
410Encoding.UTF8.GetBytes(text, arr); 557int encoded = Encoding.UTF8.GetBytes(_name, encodingBuffer); 869bytesWritten += Encoding.UTF8.GetBytes(attribute, span.Slice(bytesWritten)); 871bytesWritten += Encoding.UTF8.GetBytes(value, span.Slice(bytesWritten)); 1118int encoded = Encoding.UTF8.GetBytes(text, buffer);
System.IO.Compression (2)
System\IO\Compression\WinZipAesKeyMaterial.cs (1)
71int actualByteCount = Encoding.UTF8.GetBytes(password, rentedPasswordBytes);
System\IO\Compression\ZipCryptoStream.cs (1)
132int byteCount = Encoding.UTF8.GetBytes(password, passwordBytes);
System.Memory (3)
System\Text\EncodingExtensions.cs (3)
46int actualBytesWritten = encoding.GetBytes(chars, scratchBuffer); 108return encoding.GetBytes(chars.FirstSpan, bytes); 153encoding.GetBytes(span, retVal);
System.Net.Http (12)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (3)
480int written = valueEncoding.GetBytes(value, destination); 573int written = valueEncoding.GetBytes(values[0], destination); 581written = valueEncoding.GetBytes(values[i], destination);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (3)
203int written = valueEncoding.GetBytes(s, buffer); 278int written = valueEncoding.GetBytes(values[0], buffer); 286written = valueEncoding.GetBytes(values[i], buffer);
System\Net\Http\FormUrlEncodedContent.cs (1)
48HttpRuleParser.DefaultHttpEncoding.GetBytes(builder.AsSpan(), bytes);
System\Net\Http\Headers\KnownHeader.cs (1)
28int asciiBytes = Encoding.ASCII.GetBytes(name, asciiBytesWithColonSpace);
System\Net\Http\MultipartContent.cs (1)
645int written = encoding.GetBytes(content, buffer);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
203Encoding.ASCII.GetBytes(hostHeader, hostHeaderLine.AsSpan(6));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
525int length = encoding.GetBytes(s, _writeBuffer.AvailableSpan);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
325return checked((byte)Encoding.UTF8.GetBytes(chars, buffer));
System.Net.Ping (1)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
55int byteCount = Encoding.UTF8.GetBytes(managed, buffer);
System.Net.Primitives (1)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
60Encoding.UTF8.GetBytes(castInterfaceName, buffer);
System.Net.Security (4)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
647index += Encoding.UTF8.GetBytes(alg, buffer.AsSpan(index));
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (3)
410int dataLength = Encoding.Unicode.GetBytes(data, payload.Slice(offset)); 433Encoding.Unicode.GetBytes(password, pwBytes); 589int bytesWritten = Encoding.Unicode.GetBytes(_spn, targetInfoBuffer.AsSpan(4 + targetInfoOffset));
System.Net.ServerSentEvents (1)
System\Net\ServerSentEvents\Helpers.cs (1)
52int bytesWritten = Encoding.UTF8.GetBytes(value, buffer);
System.Private.CoreLib (22)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\SpanOfCharAsUtf8StringMarshaller.cs (1)
55int byteCount = Encoding.UTF8.GetBytes(managed, buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (1)
31int cbytes = Encoding.UTF8.GetBytes(s, bytes);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
1781Encoding.BigEndianUnicode.GetBytes(name, source.Slice(namespaceBytes.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (1)
771Encoding.UTF8.GetBytes(s, Unsafe.BitCast<Span<TChar>, Span<byte>>(result.AppendSpan(Encoding.UTF8.GetByteCount(s))));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (1)
113Encoding.UTF8.GetBytes(value, utf8);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (4)
202int actualByteCount = _encoding.GetBytes(new ReadOnlySpan<char>(in ch), buffer); 363int actualByteCount = _encoding.GetBytes(value, buffer.Slice(1)); 371int actualByteCount = _encoding.GetBytes(value, rented); 434int actualByteCount = _encoding.GetBytes(chars, rented);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
37int pos = Encoding.UTF8.GetBytes(tempPath, path); 40pos += Encoding.UTF8.GetBytes(prefix, path.Slice(pos));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
107int pos = Encoding.UTF8.GetBytes(tempPath, path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringStream.cs (1)
131int written = _encoding.GetBytes(_text.Span, buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
351Encoding.UTF8.GetBytes(state.value, utf8Bytes);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
1077int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb)); 1118int nbWritten = Encoding.UTF8.GetBytes(s, new Span<byte>(pbMem, nb));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (2)
40int convertedBytes = Encoding.UTF8.GetBytes(s, new Span<byte>(buffer, bufferLength)); 56int actualByteLength = Encoding.UTF8.GetBytes(chars, bytes);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (2)
32int byteCount = Encoding.UTF8.GetBytes(managed, buffer); 98int byteCount = Encoding.UTF8.GetBytes(managed, buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (1)
746bytesWritten = GetBytes(chars, bytes);
System\CrashInfo.cs (1)
384Encoding.UTF8.GetBytes(chars, destination);
System.Private.Windows.Core (1)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
425byteCount = Encoding.UTF8.GetBytes(value, span);
System.Security.Cryptography (8)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (3)
228int written = encoding.GetBytes(password, buf); 411int length = encoding.GetBytes(password, pwdTmpBytes); 513int written = encoding.GetBytes(password, buf);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
279int count = bigEndianUnicode.GetBytes(password, destination); 296int count = bigEndianUnicode.GetBytes(trimmed, destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (1)
338Encoding.Unicode.GetBytes(parameterSet, buffer.Slice(blobHeaderSize));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
22int written = ThrowingUtf8Encoding.GetBytes(data, _buffer);
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (1)
60int bytesWritten = Encoding.ASCII.GetBytes(oidString, new Span<byte>(pOidContents, oidString.Length));
System.Security.Cryptography.Pkcs (6)
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (1)
52Encoding.ASCII.GetBytes(s, ascii);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (3)
228int written = encoding.GetBytes(password, buf); 411int length = encoding.GetBytes(password, pwdTmpBytes); 513int written = encoding.GetBytes(password, buf);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
279int count = bigEndianUnicode.GetBytes(password, destination); 296int count = bigEndianUnicode.GetBytes(trimmed, destination);
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\FramingEncoders.cs (1)
62Encoding.UTF8.GetBytes(value, EncodedBytes.Slice(offset).Span);
System.Web.HttpUtility (3)
System\Web\HttpUtility.cs (1)
207int encodedBytes = e.GetBytes(str, bytes);
System\Web\Util\HttpEncoder.cs (2)
465int encodedBytes = e.GetBytes(str, byteSpan); 571int utf8Length = Encoding.UTF8.GetBytes(toEncode, bytes);
System.Windows.Forms.Design (1)
System\ComponentModel\Design\BinaryEditor.cs (1)
62Encoding.Unicode.GetBytes(stringValue.AsSpan(), buffer.AsSpan());