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

◆ TryParse() [1/16]

static bool System.Buffers.Text.Utf8Parser.TryParse ( ReadOnlySpan< byte > source,
out bool value,
out int bytesConsumed,
char standardFormat = '\0' )
inlinestatic

Definition at line 179 of file Utf8Parser.cs.

180 {
181 if (standardFormat != 0 && standardFormat != 'G' && standardFormat != 'l')
182 {
183 ThrowHelper.ThrowFormatException_BadFormatSpecifier();
184 }
185 if (source.Length >= 4)
186 {
187 int num = BinaryPrimitives.ReadInt32LittleEndian(source) & -538976289;
188 if (num == 1163219540)
189 {
190 bytesConsumed = 4;
191 value = true;
192 return true;
193 }
194 if (source.Length > 4 && num == 1397506374 && (source[4] & -33) == 69)
195 {
196 bytesConsumed = 5;
197 value = false;
198 return true;
199 }
200 }
201 bytesConsumed = 0;
202 value = false;
203 return false;
204 }
static int ReadInt32LittleEndian(ReadOnlySpan< byte > source)

References System.Buffers.Binary.BinaryPrimitives.ReadInt32LittleEndian(), System.source, System.ThrowHelper.ThrowFormatException_BadFormatSpecifier(), and System.value.

Referenced by System.Diagnostics.ActivitySpanId.ActivitySpanId(), System.Diagnostics.ActivityTraceId.ActivityTraceId(), System.Text.Json.Utf8JsonReader.GetDoubleWithQuotes(), System.Text.Json.Utf8JsonReader.GetSingleWithQuotes(), System.Formats.Asn1.AsnDecoder.ParseGeneralizedTime(), System.Formats.Asn1.AsnDecoder.ParseNonNegativeInt(), System.Text.Json.Serialization.Converters.TimeSpanConverter.Read(), System.Text.Json.Serialization.Converters.BooleanConverter.ReadAsPropertyNameCore(), System.Net.Http.HttpConnection.ChunkedEncodingReadStream.ReadChunkFromConnectionBuffer(), System.Text.Json.Utf8JsonReader.TryGetByteCore(), System.Text.Json.Utf8JsonReader.TryGetDecimalCore(), System.Text.Json.Utf8JsonReader.TryGetDouble(), System.Text.Json.JsonReaderHelper.TryGetEscapedGuid(), System.Text.Json.Utf8JsonReader.TryGetGuidCore(), System.Text.Json.Utf8JsonReader.TryGetInt16Core(), System.Text.Json.Utf8JsonReader.TryGetInt32Core(), System.Text.Json.Utf8JsonReader.TryGetInt64Core(), System.Text.Json.Utf8JsonReader.TryGetSByteCore(), System.Text.Json.Utf8JsonReader.TryGetSingle(), System.Text.Json.Utf8JsonReader.TryGetUInt16Core(), System.Text.Json.Utf8JsonReader.TryGetUInt32Core(), System.Text.Json.Utf8JsonReader.TryGetUInt64Core(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), System.Text.Json.JsonDocument.TryGetValue(), and System.Text.Json.JsonReaderHelper.Unescape().