58 references to AsBytes
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
676hash.Append(MemoryMarshal.AsBytes(charSpan));
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
1159int bytesWritten = XxHash128.Hash(MemoryMarshal.AsBytes(shortSpan), hash);
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Checksum_Factory.cs (1)
148pooledHash.Object.Append(MemoryMarshal.AsBytes(hashSpan));
Microsoft.Diagnostics.DataContractReader.Contracts (1)
Contracts\StackWalk\Context\ContextHolder.cs (1)
49Span<byte> byteSpan = MemoryMarshal.AsBytes(structSpan);
Microsoft.Diagnostics.DataContractReader.Legacy (2)
Dbi\DacDbiImpl.cs (2)
6807Span<byte> destBytes = MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref dest, 1)); 6816MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref value, 1)).Reverse();
Microsoft.Extensions.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
179sha256.AppendData(MemoryMarshal.AsBytes([lastChangedUtc]));
Microsoft.ML.Core (1)
Utilities\Stream.cs (1)
717rentedArray.AsSpan(0, numElementsToReadThisChunk * sizeof(T)).CopyTo(MemoryMarshal.AsBytes(destination.Slice(0, numElementsToReadThisChunk)));
Microsoft.ML.FastTree (16)
Utils\ToByteArrayExtensions.cs (16)
293MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 304buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 326MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 337buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 359MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 375buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 397MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 408buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 430MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 441buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 463MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 474buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 496MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 507buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 529MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 540buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan()));
Microsoft.ML.Tokenizers (1)
Model\SentencePieceUnigramModel.cs (1)
570Span<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)
136Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(valuesToRead.Slice(0, sliceSize)); 204Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result.AsSpan());
System.Net.Primitives (6)
System\Net\IPAddress.cs (2)
374MemoryMarshal.AsBytes<ushort>(numbers).CopyTo(destination); 722ReadOnlySpan<byte> numbers = MemoryMarshal.AsBytes<ushort>(_numbers).Slice(0, 16);
System\Net\IPNetwork.cs (4)
96BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 98address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 263baseAddress.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)
52Span<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)
941r.EncodeToUtf8(MemoryMarshal.AsBytes(vlb.AppendSpan(r.Utf8SequenceLength)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (1)
95MemoryMarshal.AsBytes(array).CopyTo(_array);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (1)
757r.EncodeToUtf8(MemoryMarshal.AsBytes(result.AppendSpan(r.Utf8SequenceLength)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (2)
530Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 618Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
349Span<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)
163if (MemoryMarshal.AsBytes(source).Overlaps(MemoryMarshal.AsBytes(destination)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
211bytes.CopyTo(MemoryMarshal.AsBytes(new Span<int>(ref _leftoverBytes)));
System.Private.DataContractSerialization (1)
System\Xml\XmlBufferReader.cs (1)
488ReadRawArrayBytes(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)
2335Span<byte> dstBytes = MemoryMarshal.AsBytes(dstChars);
System.Runtime.Numerics (8)
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
941r.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)) 1644MemoryMarshal.AsBytes(destination).Reverse();
System\Numerics\BigInteger.cs (4)
417Span<byte> limbBytes = MemoryMarshal.AsBytes(val.AsSpan(0, wholeLimbCount)); 428value.Slice(0, wholeLimbCount * nint.Size).CopyTo(MemoryMarshal.AsBytes(val.AsSpan())); 1241hash.AddBytes(MemoryMarshal.AsBytes(_bits.AsSpan())); 1664ReadOnlySpan<byte> srcBytes = MemoryMarshal.AsBytes(bits.AsSpan(..^1));
System.Security.Cryptography (2)
System\Security\Cryptography\RandomNumberGenerator.cs (1)
129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint));
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (1)
266CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(szPassword));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\BitVector.cs (1)
178hc.AddBytes(MemoryMarshal.AsBytes<ulong>(_blocks));