SequenceReader<T>.TryCopyTo(Span<T>) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies data from the current position to the given destination span if there is enough data to fill it.
public:
bool TryCopyTo(Span<T> destination);
C#
public readonly bool TryCopyTo(Span<T> destination);
member this.TryCopyTo : Span<'T (requires 'T : struct)> -> bool
Public Function TryCopyTo (destination As Span(Of T)) As Boolean
- destination
- Span<T>
Destination span to copy to.
true
if there is enough data to completely fill the destination
span; otherwise, false
.
This method copies a fixed amount of data out of the sequence if possible. It does not advance the reader. To look ahead for a specific stream of data, use IsNext(ReadOnlySpan<T>, Boolean).
產品 | 版本 |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |