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

◆ TryGetValue() [1/15]

bool System.Text.Json.JsonDocument.TryGetValue ( int index,
[NotNullWhen(true)] out byte[] value )
inlinepackage

Definition at line 547 of file JsonDocument.cs.

548 {
550 DbRow dbRow = _parsedData.Get(index);
551 CheckExpectedType(JsonTokenType.String, dbRow.TokenType);
552 ReadOnlySpan<byte> readOnlySpan = _utf8Json.Span.Slice(dbRow.Location, dbRow.SizeOrLength);
553 if (dbRow.HasComplexChildren)
554 {
555 int idx = readOnlySpan.IndexOf<byte>(92);
556 return JsonReaderHelper.TryGetUnescapedBase64Bytes(readOnlySpan, idx, out value);
557 }
558 return JsonReaderHelper.TryDecodeBase64(readOnlySpan, out value);
559 }
void CheckExpectedType(JsonTokenType expected, JsonTokenType actual)
ReadOnlyMemory< byte > _utf8Json
unsafe ReadOnlySpan< T > Span

References System.Text.Json.JsonDocument._parsedData, System.Text.Json.JsonDocument._utf8Json, System.Text.Json.JsonDocument.CheckExpectedType(), System.Text.Json.JsonDocument.CheckNotDisposed(), System.Text.Json.Dictionary, System.Text.Json.JsonDocument.MetadataDb.Get(), System.index, System.ReadOnlyMemory< T >.Span, System.Text.Json.JsonReaderHelper.TryDecodeBase64(), System.Text.Json.JsonReaderHelper.TryGetUnescapedBase64Bytes(), and System.value.

Referenced by System.Text.Json.JsonElement.TryGetByte(), System.Text.Json.JsonElement.TryGetBytesFromBase64(), System.Text.Json.JsonElement.TryGetDateTime(), System.Text.Json.JsonElement.TryGetDateTimeOffset(), System.Text.Json.JsonElement.TryGetDecimal(), System.Text.Json.JsonElement.TryGetDouble(), System.Text.Json.JsonElement.TryGetGuid(), System.Text.Json.JsonElement.TryGetInt16(), System.Text.Json.JsonElement.TryGetInt32(), System.Text.Json.JsonElement.TryGetInt64(), System.Text.Json.JsonElement.TryGetSByte(), System.Text.Json.JsonElement.TryGetSingle(), System.Text.Json.JsonElement.TryGetUInt16(), System.Text.Json.JsonElement.TryGetUInt32(), and System.Text.Json.JsonElement.TryGetUInt64().