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