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

◆ ParseNonNegativeInt()

static int System.Formats.Asn1.AsnDecoder.ParseNonNegativeInt ( ReadOnlySpan< byte > data)
inlinestaticprivate

Definition at line 314 of file AsnDecoder.cs.

315 {
316 if (Utf8Parser.TryParse(data, out uint value, out int bytesConsumed, '\0') && value <= int.MaxValue && bytesConsumed == data.Length)
317 {
318 return (int)value;
319 }
320 throw new AsnContentException();
321 }
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')

References System.Buffers.Text.Utf8Parser.TryParse(), and System.value.

Referenced by System.Formats.Asn1.AsnDecoder.ParseNonNegativeIntAndSlice().