732 references to BinaryPrimitives
CodeGenerator (1)
GenerateDocumentationAndConfigFiles (10)
http2cat (10)
IIS.FunctionalTests (10)
IIS.LongTests (10)
IIS.NewHandler.FunctionalTests (10)
IIS.NewShim.FunctionalTests (10)
IIS.ShadowCopy.Tests (6)
IISExpress.FunctionalTests (10)
InMemory.FunctionalTests (2)
Metrics (10)
Metrics.Legacy (10)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.Identity (2)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (10)
Microsoft.AspNetCore.Server.Kestrel.Core (26)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Shared.Tests (12)
Microsoft.CodeAnalysis (16)
Microsoft.CodeAnalysis.Analyzers (10)
Microsoft.CodeAnalysis.AnalyzerUtilities (10)
Microsoft.CodeAnalysis.BannedApiAnalyzers (10)
Microsoft.CodeAnalysis.CodeStyle (10)
Microsoft.CodeAnalysis.CSharp (4)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (10)
Microsoft.CodeAnalysis.PublicApiAnalyzers (10)
Microsoft.CodeAnalysis.Remote.Workspaces (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (10)
Microsoft.CodeAnalysis.Workspaces (10)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
Microsoft.DotNet.Build.Tasks.Installers (36)
src\RpmHeader.cs (28)
78Tag = BinaryPrimitives.ReadInt32BigEndian(bytes),
79Type = (RpmHeaderEntryType)BinaryPrimitives.ReadInt32BigEndian(bytes.Slice(4)),
80Offset = BinaryPrimitives.ReadInt32BigEndian(bytes.Slice(8)),
81Count = BinaryPrimitives.ReadInt32BigEndian(bytes.Slice(12))
87BinaryPrimitives.WriteInt32BigEndian(bytes, entry.Tag);
88BinaryPrimitives.WriteInt32BigEndian(bytes.Slice(4), (int)entry.Type);
89BinaryPrimitives.WriteInt32BigEndian(bytes.Slice(8), entry.Offset);
90BinaryPrimitives.WriteInt32BigEndian(bytes.Slice(12), entry.Count);
112int numIndexEntries = BinaryPrimitives.ReadInt32BigEndian(stream.ReadExactly(4));
113int numHeaderBytes = BinaryPrimitives.ReadInt32BigEndian(stream.ReadExactly(4));
210contents.SetValue(BinaryPrimitives.ReadInt16BigEndian(store.AsSpan().Slice(offset.AlignUp(2), 2)), i);
215contents.SetValue(BinaryPrimitives.ReadInt32BigEndian(store.AsSpan().Slice(offset.AlignUp(4), 4)), i);
220contents.SetValue(BinaryPrimitives.ReadInt64BigEndian(store.AsSpan().Slice(offset.AlignUp(8), 8)), i);
240BinaryPrimitives.WriteInt32BigEndian(numIndexEntries, Entries.Count + 1);
251BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes, Convert.ToInt32(entry.Tag));
252BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(4), (int)entry.Type);
255BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length);
260BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), binary.Count);
268BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length);
269BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), 1);
278BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length);
282BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), strings.Length);
304BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(8), (int)storeStream.Length);
308BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), contents.Length);
322BinaryPrimitives.WriteInt16BigEndian(tempBeBytes, (short)contents.GetValue(i)!);
326BinaryPrimitives.WriteInt32BigEndian(tempBeBytes, (int)contents.GetValue(i)!);
330BinaryPrimitives.WriteInt64BigEndian(tempBeBytes, (long)contents.GetValue(i)!);
365BinaryPrimitives.WriteInt32BigEndian(numHeaderBytes, (int)storeStream.Length);
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.Caching.Hybrid (10)
Microsoft.Extensions.ServiceDiscovery.Dns (26)
Resolver\DnsPrimitives.cs (20)
28TransactionId = BinaryPrimitives.ReadUInt16BigEndian(buffer),
29QueryFlags = (QueryFlags)BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(2)),
30QueryCount = BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(4)),
31AnswerCount = BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(6)),
32AuthorityCount = BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(8)),
33AdditionalRecordCount = BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(10))
49BinaryPrimitives.WriteUInt16BigEndian(buffer, header.TransactionId);
50BinaryPrimitives.WriteUInt16BigEndian(buffer.Slice(2), (ushort)header.QueryFlags);
51BinaryPrimitives.WriteUInt16BigEndian(buffer.Slice(4), header.QueryCount);
52BinaryPrimitives.WriteUInt16BigEndian(buffer.Slice(6), header.AnswerCount);
53BinaryPrimitives.WriteUInt16BigEndian(buffer.Slice(8), header.AuthorityCount);
54BinaryPrimitives.WriteUInt16BigEndian(buffer.Slice(10), header.AdditionalRecordCount);
276if (!BinaryPrimitives.TryReadUInt16BigEndian(buffer.Span, out priority) ||
277!BinaryPrimitives.TryReadUInt16BigEndian(buffer.Span.Slice(2), out weight) ||
278!BinaryPrimitives.TryReadUInt16BigEndian(buffer.Span.Slice(4), out port) ||
298!BinaryPrimitives.TryReadUInt32BigEndian(buffer.Span.Slice(w1 + w2), out serial) ||
299!BinaryPrimitives.TryReadUInt32BigEndian(buffer.Span.Slice(w1 + w2 + 4), out refresh) ||
300!BinaryPrimitives.TryReadUInt32BigEndian(buffer.Span.Slice(w1 + w2 + 8), out retry) ||
301!BinaryPrimitives.TryReadUInt32BigEndian(buffer.Span.Slice(w1 + w2 + 12), out expire) ||
302!BinaryPrimitives.TryReadUInt32BigEndian(buffer.Span.Slice(w1 + w2 + 16), out minimum))
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (10)
Resolver\LoopbackDnsServer.cs (10)
99length = BinaryPrimitives.ReadUInt16BigEndian(buffer.AsSpan(0, 2));
104BinaryPrimitives.WriteUInt16BigEndian(buffer.AsSpan(0, 2), (ushort)bytesWritten);
258if (!BinaryPrimitives.TryWriteUInt16BigEndian(buff, priority) ||
259!BinaryPrimitives.TryWriteUInt16BigEndian(buff.AsSpan(2), weight) ||
260!BinaryPrimitives.TryWriteUInt16BigEndian(buff.AsSpan(4), port) ||
279!BinaryPrimitives.TryWriteUInt32BigEndian(buff.AsSpan(w1 + w2), serial) ||
280!BinaryPrimitives.TryWriteUInt32BigEndian(buff.AsSpan(w1 + w2 + 4), refresh) ||
281!BinaryPrimitives.TryWriteUInt32BigEndian(buff.AsSpan(w1 + w2 + 8), retry) ||
282!BinaryPrimitives.TryWriteUInt32BigEndian(buff.AsSpan(w1 + w2 + 12), expire) ||
283!BinaryPrimitives.TryWriteUInt32BigEndian(buff.AsSpan(w1 + w2 + 16), minimum))
mscorlib (1)
netstandard (1)
Roslyn.Diagnostics.Analyzers (10)
System.Diagnostics.DiagnosticSource (3)
System.Formats.Asn1 (4)
System.Formats.Cbor (14)
System.Formats.Nrbf (3)
System.Formats.Tar (3)
System.IO.Hashing (37)
System.Memory (4)
System.Private.CoreLib (172)
System.Private.DataContractSerialization (39)
System\Xml\XmlBinaryWriter.cs (19)
134=> WriteTextNodeRaw<short>(nodeType, BitConverter.IsLittleEndian ? value : BinaryPrimitives.ReverseEndianness((value)));
137=> WriteTextNodeRaw<int>(nodeType, BitConverter.IsLittleEndian ? value : BinaryPrimitives.ReverseEndianness((value)));
140=> WriteTextNodeRaw<long>(nodeType, BitConverter.IsLittleEndian ? value : BinaryPrimitives.ReverseEndianness((value)));
513=> WriteRaw<long>(BitConverter.IsLittleEndian ? value : BinaryPrimitives.ReverseEndianness(value));
738BinaryPrimitives.WriteSingleLittleEndian(span.Slice(1), f);
763BinaryPrimitives.WriteDoubleLittleEndian(span.Slice(1), d);
783BinaryPrimitives.WriteInt32LittleEndian(span.Slice(0 + 1), bits[3]);
784BinaryPrimitives.WriteInt32LittleEndian(span.Slice(4 + 1), bits[2]);
785BinaryPrimitives.WriteInt32LittleEndian(span.Slice(8 + 1), bits[0]);
786BinaryPrimitives.WriteInt32LittleEndian(span.Slice(12 + 1), bits[1]);
876WriteRaw(BinaryPrimitives.ReverseEndianness(s));
892WriteRaw(BinaryPrimitives.ReverseEndianness(i));
908WriteRaw(BinaryPrimitives.ReverseEndianness(l));
925BinaryPrimitives.WriteSingleLittleEndian(span, f);
943BinaryPrimitives.WriteDoubleLittleEndian(span, d);
965BinaryPrimitives.WriteInt32LittleEndian(span, bits[3]);
966BinaryPrimitives.WriteInt32LittleEndian(span.Slice(4), bits[2]);
967BinaryPrimitives.WriteInt32LittleEndian(span.Slice(8), bits[0]);
968BinaryPrimitives.WriteInt32LittleEndian(span.Slice(12), bits[1]);
System\Xml\XmlBufferReader.cs (18)
356=> BitConverter.IsLittleEndian ? ReadRawBytes<ushort>() : BinaryPrimitives.ReverseEndianness(ReadRawBytes<ushort>());
362=> BitConverter.IsLittleEndian ? ReadRawBytes<int>() : BinaryPrimitives.ReverseEndianness(ReadRawBytes<int>());
373=> BitConverter.IsLittleEndian ? ReadRawBytes<long>() : BinaryPrimitives.ReverseEndianness(ReadRawBytes<long>());
377float f = BinaryPrimitives.ReadSingleLittleEndian(GetBuffer(sizeof(float), out int offset).AsSpan(offset, sizeof(float)));
384double d = BinaryPrimitives.ReadDoubleLittleEndian(GetBuffer(sizeof(double), out int offset).AsSpan(offset, sizeof(double)));
401BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(8, 4)),
402BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(12, 4)),
403BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(4, 4)),
404BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(0, 4))
952=> BitConverter.IsLittleEndian ? ReadRawBytes<short>(offset) : BinaryPrimitives.ReverseEndianness(ReadRawBytes<short>(offset));
955=> BitConverter.IsLittleEndian ? ReadRawBytes<int>(offset) : BinaryPrimitives.ReverseEndianness(ReadRawBytes<int>(offset));
958=> BitConverter.IsLittleEndian ? ReadRawBytes<long>(offset) : BinaryPrimitives.ReverseEndianness(ReadRawBytes<long>(offset));
964=> BinaryPrimitives.ReadSingleLittleEndian(_buffer.AsSpan(offset, sizeof(float)));
967=> BinaryPrimitives.ReadDoubleLittleEndian(_buffer.AsSpan(offset, sizeof(double)));
980BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(8, 4)),
981BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(12, 4)),
982BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(4, 4)),
983BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(0, 4))
System.Private.Uri (1)
System.Private.Windows.Core (3)
System.Private.Xml (15)
System.Reflection.Emit (5)
System.Reflection.Metadata (7)
System.Resources.Extensions (2)
System.Runtime.Numerics (11)
System.Security.Cryptography.Cose (3)
System.Text.Encoding.CodePages (22)
System.Text.Encodings.Web (2)
System.Windows.Forms.UI.IntegrationTests (3)
Test.Utilities (10)
Text.Analyzers (10)