Επεξεργασία

Κοινή χρήση μέσω


SequenceReader<T>.TryCopyTo(Span<T>) Method

Definition

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);
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

Parameters

destination
Span<T>

Destination span to copy to.

Returns

true if there is enough data to completely fill the destination span; otherwise, false.

Remarks

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).

Applies to