58 references to AsBytes
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
676
hash.Append(MemoryMarshal.
AsBytes
(charSpan));
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
1159
int bytesWritten = XxHash128.Hash(MemoryMarshal.
AsBytes
(shortSpan), hash);
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Checksum_Factory.cs (1)
148
pooledHash.Object.Append(MemoryMarshal.
AsBytes
(hashSpan));
Microsoft.Diagnostics.DataContractReader.Contracts (1)
Contracts\StackWalk\Context\ContextHolder.cs (1)
49
Span<byte> byteSpan = MemoryMarshal.
AsBytes
(structSpan);
Microsoft.Diagnostics.DataContractReader.Legacy (2)
Dbi\DacDbiImpl.cs (2)
6807
Span<byte> destBytes = MemoryMarshal.
AsBytes
(MemoryMarshal.CreateSpan(ref dest, 1));
6816
MemoryMarshal.
AsBytes
(MemoryMarshal.CreateSpan(ref value, 1)).Reverse();
Microsoft.Extensions.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
179
sha256.AppendData(MemoryMarshal.
AsBytes
([lastChangedUtc]));
Microsoft.ML.Core (1)
Utilities\Stream.cs (1)
717
rentedArray.AsSpan(0, numElementsToReadThisChunk * sizeof(T)).CopyTo(MemoryMarshal.
AsBytes
(destination.Slice(0, numElementsToReadThisChunk)));
Microsoft.ML.FastTree (16)
Utils\ToByteArrayExtensions.cs (16)
293
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
304
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
326
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
337
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
359
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
375
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
397
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
408
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
430
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
441
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
463
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
474
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
496
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
507
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
529
MemoryMarshal.
AsBytes
(a.AsSpan()).CopyTo(buffer.AsSpan(position));
540
buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.
AsBytes
(a.AsSpan()));
Microsoft.ML.Tokenizers (1)
Model\SentencePieceUnigramModel.cs (1)
570
Span<byte> byteSpan = MemoryMarshal.
AsBytes
(buffer.AsSpan());
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
2099
_hexString = Convert.ToHexStringLower(MemoryMarshal.
AsBytes
(span));
System.Formats.Nrbf (2)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (2)
136
Span<byte> resultAsBytes = MemoryMarshal.
AsBytes
<T>(valuesToRead.Slice(0, sliceSize));
204
Span<byte> resultAsBytes = MemoryMarshal.
AsBytes
<T>(result.AsSpan());
System.Net.Primitives (6)
System\Net\IPAddress.cs (2)
374
MemoryMarshal.
AsBytes
<ushort>(numbers).CopyTo(destination);
722
ReadOnlySpan<byte> numbers = MemoryMarshal.
AsBytes
<ushort>(_numbers).Slice(0, 16);
System\Net\IPNetwork.cs (4)
96
BaseAddress.TryWriteBytes(MemoryMarshal.
AsBytes
(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten);
98
address.TryWriteBytes(MemoryMarshal.
AsBytes
(new Span<UInt128>(ref otherAddressValue)), out bytesWritten);
263
baseAddress.TryWriteBytes(MemoryMarshal.
AsBytes
(new Span<UInt128>(ref value)), out int bytesWritten);
275
: new IPAddress(MemoryMarshal.
AsBytes
(new Span<UInt128>(ref newAddress)));
System.Net.Quic (1)
System\Net\Quic\Internal\MsQuicHelpers.cs (1)
52
Span<byte> rawAddress = MemoryMarshal.
AsBytes
(MemoryMarshal.CreateSpan(ref result, 1));
System.Private.CoreLib (8)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
941
r.EncodeToUtf8(MemoryMarshal.
AsBytes
(vlb.AppendSpan(r.Utf8SequenceLength)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (1)
95
MemoryMarshal.
AsBytes
(array).CopyTo(_array);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (1)
757
r.EncodeToUtf8(MemoryMarshal.
AsBytes
(result.AppendSpan(r.Utf8SequenceLength)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (2)
530
Span<byte> bytes = MemoryMarshal.
AsBytes
(new Span<GuidResult>(ref result));
618
Span<byte> bytes = MemoryMarshal.
AsBytes
(new Span<GuidResult>(ref result));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
349
Span<byte> utf8Bytes = MemoryMarshal.
AsBytes
(dest).Slice(dest.Length * 2 - state.byteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (1)
163
if (MemoryMarshal.AsBytes(source).Overlaps(MemoryMarshal.
AsBytes
(destination)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
211
bytes.CopyTo(MemoryMarshal.
AsBytes
(new Span<int>(ref _leftoverBytes)));
System.Private.DataContractSerialization (1)
System\Xml\XmlBufferReader.cs (1)
488
ReadRawArrayBytes(MemoryMarshal.
AsBytes
(dst));
System.Private.Windows.GdiPlus (2)
_generated\60\Windows.Win32.PInvokeGdiPlus.gdiplus.dll.g.cs (2)
3908
return GdipGetImageDecoders(numDecoders, global::System.Runtime.InteropServices.MemoryMarshal.
AsBytes
(new Span<winmdroot.Graphics.GdiPlus.ImageCodecInfo>(ref decoders)));
3965
return GdipGetImageEncoders(numEncoders, global::System.Runtime.InteropServices.MemoryMarshal.
AsBytes
(new Span<winmdroot.Graphics.GdiPlus.ImageCodecInfo>(ref encoders)));
System.Private.Xml (1)
System\Xml\BinaryXml\XmlBinaryReader.cs (1)
2335
Span<byte> dstBytes = MemoryMarshal.
AsBytes
(dstChars);
System.Runtime.Numerics (8)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
941
r.EncodeToUtf8(MemoryMarshal.
AsBytes
(vlb.AppendSpan(r.Utf8SequenceLength)));
System\Number.BigInteger.cs (3)
1636
? (Convert.FromHexString(Unsafe.BitCast<ReadOnlySpan<TChar>, ReadOnlySpan<byte>>(input), MemoryMarshal.
AsBytes
(destination), out _, out _) != OperationStatus.Done)
1637
: (Convert.FromHexString(Unsafe.BitCast<ReadOnlySpan<TChar>, ReadOnlySpan<char>>(input), MemoryMarshal.
AsBytes
(destination), out _, out _) != OperationStatus.Done))
1644
MemoryMarshal.
AsBytes
(destination).Reverse();
System\Numerics\BigInteger.cs (4)
417
Span<byte> limbBytes = MemoryMarshal.
AsBytes
(val.AsSpan(0, wholeLimbCount));
428
value.Slice(0, wholeLimbCount * nint.Size).CopyTo(MemoryMarshal.
AsBytes
(val.AsSpan()));
1241
hash.AddBytes(MemoryMarshal.
AsBytes
(_bits.AsSpan()));
1664
ReadOnlySpan<byte> srcBytes = MemoryMarshal.
AsBytes
(bits.AsSpan(..^1));
System.Security.Cryptography (2)
System\Security\Cryptography\RandomNumberGenerator.cs (1)
129
Span<byte> oneUintBytes = MemoryMarshal.
AsBytes
(new Span<uint>(ref oneUint));
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (1)
266
CryptographicOperations.ZeroMemory(MemoryMarshal.
AsBytes
(szPassword));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\BitVector.cs (1)
178
hc.AddBytes(MemoryMarshal.
AsBytes
<ulong>(_blocks));