Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AppendSections()

static void System.Net.IPAddressParser.AppendSections ( ushort[] address,
int fromInclusive,
int toExclusive,
StringBuilder buffer )
inlinestaticprivate

Definition at line 181 of file IPAddressParser.cs.

182 {
183 ReadOnlySpan<ushort> numbers = new ReadOnlySpan<ushort>(address, fromInclusive, toExclusive - fromInclusive);
184 (int longestSequenceStart, int longestSequenceLength) tuple = System.IPv6AddressHelper.FindCompressionRange(numbers);
185 int item = tuple.longestSequenceStart;
186 int item2 = tuple.longestSequenceLength;
187 bool flag = false;
188 for (int i = fromInclusive; i < item; i++)
189 {
190 if (flag)
191 {
192 buffer.Append(':');
193 }
194 flag = true;
195 AppendHex(address[i], buffer);
196 }
197 if (item >= 0)
198 {
199 buffer.Append("::");
200 flag = false;
201 fromInclusive = item2;
202 }
203 for (int j = fromInclusive; j < toExclusive; j++)
204 {
205 if (flag)
206 {
207 buffer.Append(':');
208 }
209 flag = true;
210 AppendHex(address[j], buffer);
211 }
212 }
static int int longestSequenceLength FindCompressionRange(ReadOnlySpan< ushort > numbers)
static void AppendHex(ushort value, StringBuilder buffer)

References System.Net.IPAddressParser.AppendHex(), System.buffer, System.IPv6AddressHelper.FindCompressionRange(), and System.item.

Referenced by System.Net.IPAddressParser.IPv6AddressToStringHelper().