PipeWriter.GetSpan(Int32) 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.
Returns a Span<T> to write to that is at least the requested size, as specified by the sizeHint
parameter.
public abstract Span<byte> GetSpan (int sizeHint = 0);
abstract member GetSpan : int -> Span<byte>
Public MustOverride Function GetSpan (Optional sizeHint As Integer = 0) As Span(Of Byte)
- sizeHint
- Int32
The minimum length of the returned Span<T>. If 0, a non-empty buffer of arbitrary size is returned.
A buffer of at least sizeHint
bytes. If sizeHint
is 0, returns a non-empty buffer of arbitrary size.
The requested buffer size is not available.
There is no guarantee that successive calls will return the same buffer or the same-sized buffer.
This method never returns Span<T>.Empty, but it throws an OutOfMemoryException if the requested buffer size is not available.
You must request a new buffer after calling Advance(Int32) to continue writing more data; you cannot write to a previously acquired buffer.
Produto | Versões |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: