Skip to content

Commit 6729d89

Browse files
committed
Add docs for DecodeLength and TryDecodeLength
1 parent 25c8d26 commit 6729d89

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

xml/System.Formats.Asn1/AsnDecoder.xml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,25 @@
4343
<Parameter Name="bytesConsumed" Type="System.Int32" RefType="out" Index="2" FrameworkAlternate="net-8.0;net-9.0;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0" />
4444
</Parameters>
4545
<Docs>
46-
<param name="source">To be added.</param>
47-
<param name="ruleSet">To be added.</param>
48-
<param name="bytesConsumed">To be added.</param>
49-
<summary>To be added.</summary>
50-
<returns>To be added.</returns>
51-
<remarks>To be added.</remarks>
46+
<param name="source">The buffer containing encoded data.</param>
47+
<param name="ruleSet">The encoding constraints to use when interpreting the data.</param>
48+
<param name="bytesConsumed">
49+
<para>When this method returns, the number of bytes from the beginning of <paramref name="source" /> that contributed to the length.</para>
50+
<para>This parameter is treated as uninitialized.</para>
51+
</param>
52+
<summary>
53+
<para>Decodes the data in <paramref name="source" /> as a length value under the specified encoding rules.</para>
54+
</summary>
55+
<returns>
56+
<para>The decoded value of the length, or <see langword="null" /> if the encoded length represents the indefinite length.</para>
57+
</returns>
58+
<remarks>
59+
<para>This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet, so <paramref name="source" /> needs to have already sliced off the encoded tag.</para>
60+
</remarks>
61+
<exception cref="T:System.ArgumentOutOfRangeException">
62+
<paramref name="ruleSet" /> is not a known <see cref="T:System.Formats.Asn1.AsnEncodingRules" /> value.</exception>
63+
<exception cref="T:System.Formats.Asn1.AsnContentException">
64+
<paramref name="source" /> does not decode as a length under the specified encoding rules.</exception>
5265
</Docs>
5366
</Member>
5467
<Member MemberName="ReadBitString">
@@ -1165,13 +1178,28 @@ The contents are not valid under the current encoding rules.</exception>
11651178
<Parameter Name="bytesConsumed" Type="System.Int32" RefType="out" Index="3" FrameworkAlternate="net-8.0;net-9.0;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0" />
11661179
</Parameters>
11671180
<Docs>
1168-
<param name="source">To be added.</param>
1169-
<param name="ruleSet">To be added.</param>
1170-
<param name="decodedLength">To be added.</param>
1171-
<param name="bytesConsumed">To be added.</param>
1172-
<summary>To be added.</summary>
1173-
<returns>To be added.</returns>
1174-
<remarks>To be added.</remarks>
1181+
<param name="source">The buffer containing encoded data.</param>
1182+
<param name="ruleSet">The encoding constraints to use when interpreting the data.</param>
1183+
<param name="decodedLength">
1184+
<para>When this method returns, the decoded value of the length, or <see langword="null" /> if the encoded length represents the indefinite length.</para>
1185+
<para>This parameter is treated as uninitialized.</para>
1186+
</param>
1187+
<param name="bytesConsumed">
1188+
<para>When this method returns, the number of bytes from the beginning of <paramref name="source" /> that contributed to the length.</para>
1189+
<para>This parameter is treated as uninitialized.</para>
1190+
</param>
1191+
<summary>
1192+
<para>Attempts to decode the data in <paramref name="source" /> as a length value under the specified encoding rules.</para>
1193+
</summary>
1194+
<returns>
1195+
<para>
1196+
<see langword="true" /> if the buffer represents a valid length under the specified encoding rules; otherwise, <see langword="false" /></para>
1197+
</returns>
1198+
<remarks>
1199+
<para>This method only processes the length portion of an ASN.1/BER Tag-Length-Value triplet, so <paramref name="source" /> needs to have already sliced off the encoded tag.</para>
1200+
</remarks>
1201+
<exception cref="T:System.ArgumentOutOfRangeException">
1202+
<paramref name="ruleSet" /> is not a known <see cref="T:System.Formats.Asn1.AsnEncodingRules" /> value.</exception>
11751203
</Docs>
11761204
</Member>
11771205
<Member MemberName="TryReadBitString">

0 commit comments

Comments
 (0)