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

◆ ParseHostNumber() [2/2]

static int System.IPv4AddressHelper.ParseHostNumber ( ReadOnlySpan< char > str,
int start,
int end )
inlinestaticpackage

Definition at line 39 of file IPv4AddressHelper.cs.

40 {
41 Span<byte> span = stackalloc byte[4];
42 for (int i = 0; i < span.Length; i++)
43 {
44 int num = 0;
45 char c;
46 while (start < end && (c = str[start]) != '.' && c != ':')
47 {
48 num = num * 10 + c - 48;
49 start++;
50 }
51 span[i] = (byte)num;
52 start++;
53 }
55 }
static int ReadInt32BigEndian(ReadOnlySpan< byte > source)

References System.Span< T >.Length, System.Buffers.Binary.BinaryPrimitives.ReadInt32BigEndian(), System.start, and System.str.