21 references to GetBytesMode
System.Runtime.Numerics (21)
System\Numerics\BigInteger.cs (21)
1908return TryGetBytes(GetBytesMode.AllocateArray, default, isUnsigned, isBigEndian, ref ignored)!; 1925if (TryGetBytes(GetBytesMode.Span, destination, isUnsigned, isBigEndian, ref bytesWritten) is null) 1937return TryGetBytes(GetBytesMode.Span, destination, isUnsigned, isBigEndian, ref bytesWritten) is not null; 1947TryGetBytes(GetBytesMode.Count, default, isUnsigned, IsBigEndian, ref count); 1951/// <summary>Mode used to enable sharing <see cref="TryGetBytes(GetBytesMode, Span{byte}, bool, bool, ref int)"/> for multiple purposes.</summary> 1961/// <param name="destination">The destination span, if mode is <see cref="GetBytesMode.Span"/>.</param> 1965/// If <paramref name="mode"/>==<see cref="GetBytesMode.AllocateArray"/>, ignored. 1966/// If <paramref name="mode"/>==<see cref="GetBytesMode.Count"/>, the number of bytes that would be written. 1967/// If <paramref name="mode"/>==<see cref="GetBytesMode.Span"/>, the number of bytes written to the span or that would be written if it were long enough. 1970/// If <paramref name="mode"/>==<see cref="GetBytesMode.AllocateArray"/>, the result array. 1971/// If <paramref name="mode"/>==<see cref="GetBytesMode.Count"/>, null. 1972/// If <paramref name="mode"/>==<see cref="GetBytesMode.Span"/>, non-null if the span was long enough, null if there wasn't enough room. 1975private byte[]? TryGetBytes(GetBytesMode mode, Span<byte> destination, bool isUnsigned, bool isBigEndian, ref int bytesWritten) 1977Debug.Assert(mode is GetBytesMode.AllocateArray or GetBytesMode.Count or GetBytesMode.Span, $"Unexpected mode {mode}."); 1978Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 1985case GetBytesMode.AllocateArray: 1988case GetBytesMode.Count: 2081case GetBytesMode.AllocateArray: 2085case GetBytesMode.Count: