You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the IBufferWriter contract definition doc to be clearer (#1949)
* Update the IBufferWriter contract definition doc to be clearer
See dotnet/corefx#35554 for changes to the source.
Please review if the formatting and style/tone is appropriate.
cc @mairaw
* Eliminated duplicate remarks tags.
* Attempting to address build error
* Eliminated duplicate tags.
Copy file name to clipboardExpand all lines: xml/System.Buffers/IBufferWriter`1.xml
+32-12Lines changed: 32 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@
17
17
<Interfaces />
18
18
<Docs>
19
19
<typeparamname="T">The type of the items in the <seecref="T:System.Buffers.IBufferWriter`1" />.</typeparam>
20
-
<summary>Represents a <typeparamrefname="T" /> sink.</summary>
20
+
<summary>Represents a <typeparamrefname="T" /> output sink into which data can be written.</summary>
21
21
<remarks>To be added.</remarks>
22
22
</Docs>
23
23
<Members>
@@ -43,8 +43,8 @@
43
43
</Parameters>
44
44
<Docs>
45
45
<paramname="count">The number of data items written to the <seecref="T:System.Span`1" /> or <seecref="T:System.Memory`1" />.</param>
46
-
<summary>Notifies the <seecref="T:System.Buffers.IBufferWriter`1" /> that <paramrefname="count" /> data items were written to the <seecref="T:System.Span`1" /> or <seecref="T:System.Memory`1" />.</summary>
47
-
<remarks>To be added.</remarks>
46
+
<summary>Notifies the <seecref="T:System.Buffers.IBufferWriter`1" /> that <paramrefname="count" /> data items were written to the output <seecref="T:System.Span`1" /> or <seecref="T:System.Memory`1" />.</summary>
47
+
<remarks>You must request a new buffer after calling Advance to continue writing more data; you cannot write to a previously acquired buffer.</remarks>
48
48
</Docs>
49
49
</Member>
50
50
<MemberMemberName="GetMemory">
@@ -67,10 +67,21 @@
67
67
<ParameterName="sizeHint"Type="System.Int32" />
68
68
</Parameters>
69
69
<Docs>
70
-
<paramname="sizeHint">The size of the <seecref="T:System.Memory`1" /> requested. If 0, requests currently available memory. </param>
71
-
<summary>Requests a <seecref="T:System.Memory`1" /> that is at least <paramrefname="sizeHint" /> in size if possible.</summary>
72
-
<returns>A <seecref="T:System.Memory`1" /> of size <paramrefname="sizeHint" />, if it's available; otherwise, a <seecref="T:System.Memory`1" /> with the maximum available memory. If <paramrefname="sizeHint" /> is 0, returns currently available memory.</returns>
73
-
<remarks>To be added.</remarks>
70
+
<paramname="sizeHint">The minimum length of the returned <seecref="T:System.Memory`1" />. If 0, some, non-empty buffer is returned. </param>
71
+
<summary>Returns a <seecref="T:System.Memory`1" /> to write to that is at least the requested size (specified by <paramrefname="sizeHint" />).</summary>
72
+
<returns>A <seecref="T:System.Memory`1" /> of at least the size <paramrefname="sizeHint" />. If <paramrefname="sizeHint" /> is 0, returns a non-empty buffer.</returns>
73
+
<remarks>
74
+
<formattype="text/markdown"><![CDATA[
75
+
76
+
There is no guarantee that successive calls will return the same buffer or the same-sized buffer.
77
+
78
+
This must never return <xref:System.Span%601.Empty?displayProperty=nameWithType>, but it can throw <xref:System.OutOfMemoryException> if the requested buffer size is not available.
79
+
80
+
You must request a new buffer after calling `Advance` to continue writing more data; you cannot write to a previously acquired buffer.
81
+
82
+
]]></format>
83
+
</remarks>
84
+
<exceptioncref="T:System.OutOfMemoryException">The requested buffer size is not available.</exception>
74
85
</Docs>
75
86
</Member>
76
87
<MemberMemberName="GetSpan">
@@ -93,11 +104,20 @@
93
104
<ParameterName="sizeHint"Type="System.Int32" />
94
105
</Parameters>
95
106
<Docs>
96
-
<paramname="sizeHint">The size of the memory span requested. If 0, requests currently available memory. </param>
97
-
<summary>Requests a span that is at least <paramrefname="sizeHint" /> in size if possible.</summary>
98
-
<returns>A span of size <paramrefname="sizeHint" />, if it's available; otherwise, a memory span with the maximum available memory. If <paramrefname="sizeHint" /> is 0, returns currently available memory.</returns>
99
-
<remarks>To be added.</remarks>
107
+
<paramname="sizeHint">The minimum length of the returned <seecref="T:System.Span`1" />. If 0, some, non-empty buffer is returned. </param>
108
+
<summary>Returns a <seecref="T:System.Span`1" /> to write to that is at least the requested size (specified by <paramrefname="sizeHint" />).</summary>
109
+
<returns>A <seecref="T:System.Span`1" /> of at least the size <paramrefname="sizeHint" />. If <paramrefname="sizeHint" /> is 0, returns a non-empty buffer.</returns>
110
+
<remarks>
111
+
<formattype="text/markdown"><![CDATA[
112
+
113
+
There is no guarantee that successive calls will return the same buffer or the same-sized buffer.
114
+
115
+
This method must never return <xref:System.Span%601.Empty?displayProperty=nameWithType>, but it can throw <xref:System.OutOfMemoryException> if the requested buffer size is not available.
116
+
117
+
You must request a new buffer after calling `Advance` to continue writing more data; you cannot write to a previously acquired buffer.
0 commit comments