51 references to AsBytes
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
664hash.Append(MemoryMarshal.AsBytes(charSpan));
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Checksum_Factory.cs (1)
145pooledHash.Object.Append(MemoryMarshal.AsBytes(hashSpan));
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
145bytes.AsSpan(0, bytesWritten).CopyTo(MemoryMarshal.AsBytes(vector.AsSpan()));
Microsoft.Extensions.Identity.Core (1)
UserManager.cs (1)
2100RandomNumberGenerator.Fill(MemoryMarshal.AsBytes(resultBuffer));
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)
295Span<byte> byteSpan = MemoryMarshal.AsBytes(buffer.AsSpan());
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.cs (1)
1988_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 (5)
System\Net\IPAddress.cs (2)
373MemoryMarshal.AsBytes<ushort>(numbers).CopyTo(destination); 721ReadOnlySpan<byte> numbers = MemoryMarshal.AsBytes<ushort>(_numbers);
System\Net\IPNetwork.cs (3)
111BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 113address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 264baseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref value)), out int bytesWritten);
System.Net.Quic (1)
System\Net\Quic\Internal\MsQuicHelpers.cs (1)
52Span<byte> rawAddress = MemoryMarshal.AsBytes(MemoryMarshal.CreateSpan(ref result, 1));
System.Net.Security (1)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (1)
341Span<byte> span = MemoryMarshal.AsBytes(new Span<MessageField>(ref field));
System.Private.CoreLib (8)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
880r.EncodeToUtf8(MemoryMarshal.AsBytes(vlb.AppendSpan(r.Utf8SequenceLength)));
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
2482OperationStatus status = Base64.EncodeToUtf8(bytes, MemoryMarshal.AsBytes(chars), out _, out int bytesWritten);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (1)
757r.EncodeToUtf8(MemoryMarshal.AsBytes(result.AppendSpan(r.Utf8SequenceLength)));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (2)
518Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result)); 604Span<byte> bytes = MemoryMarshal.AsBytes(new Span<GuidResult>(ref result));
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
349Span<byte> utf8Bytes = MemoryMarshal.AsBytes(dest).Slice(dest.Length * 2 - state.byteCount);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (1)
162if (MemoryMarshal.AsBytes(source).Overlaps(MemoryMarshal.AsBytes(destination)))
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
210bytes.CopyTo(MemoryMarshal.AsBytes(new Span<int>(ref _leftoverBytes)));
System.Private.DataContractSerialization (1)
System\Xml\XmlBufferReader.cs (1)
488ReadRawArrayBytes(MemoryMarshal.AsBytes(dst));
System.Private.Xml (1)
System\Xml\BinaryXml\XmlBinaryReader.cs (1)
2335Span<byte> dstBytes = MemoryMarshal.AsBytes(dstChars);
System.Runtime.Numerics (7)
src\libraries\Common\src\System\Number.Formatting.Common.cs (1)
880r.EncodeToUtf8(MemoryMarshal.AsBytes(vlb.AppendSpan(r.Utf8SequenceLength)));
System\Number.BigInteger.cs (2)
1269if (Convert.FromHexString(MemoryMarshal.Cast<TChar, char>(input), MemoryMarshal.AsBytes(destination), out _, out _) != OperationStatus.Done) 1276MemoryMarshal.AsBytes(destination).Reverse();
System\Numerics\BigInteger.cs (4)
375Span<byte> uintBytes = MemoryMarshal.AsBytes(val.AsSpan(0, wholeUInt32Count)); 387value.Slice(0, wholeUInt32Count * 4).CopyTo(MemoryMarshal.AsBytes<uint>(val.AsSpan())); 1092hash.AddBytes(MemoryMarshal.AsBytes(_bits.AsSpan())); 1455ReadOnlySpan<byte> srcBytes = MemoryMarshal.AsBytes(bits.AsSpan(..^1));
System.Security.Cryptography (1)
System\Security\Cryptography\RandomNumberGenerator.cs (1)
129Span<byte> oneUintBytes = MemoryMarshal.AsBytes(new Span<uint>(ref oneUint));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\BitVector.cs (1)
178hc.AddBytes(MemoryMarshal.AsBytes<ulong>(_blocks));