Esempio n. 1
0
            /// <inheritdoc />
            public override bool TryGetBufferedUtf8StringValue(
                IJsonNavigatorNode stringNode,
                out ReadOnlyMemory <byte> bufferedUtf8StringValue)
            {
                ReadOnlyMemory <byte> buffer = JsonBinaryNavigator.GetNodeOfType(
                    JsonNodeType.String,
                    stringNode);

                return(JsonBinaryEncoding.TryGetBufferedUtf8StringValue(buffer, this.jsonStringDictionary, out bufferedUtf8StringValue));
            }
Esempio n. 2
0
            /// <inheritdoc />
            public override bool TryGetBufferedUtf8StringValue(out ReadOnlyMemory <byte> bufferedUtf8StringValue)
            {
                if (!(
                        (this.JsonObjectState.CurrentTokenType == JsonTokenType.String) ||
                        (this.JsonObjectState.CurrentTokenType == JsonTokenType.FieldName)))
                {
                    throw new JsonInvalidTokenException();
                }

                return(JsonBinaryEncoding.TryGetBufferedUtf8StringValue(
                           this.jsonBinaryBuffer.GetBufferedRawJsonToken(this.currentTokenPosition),
                           this.jsonStringDictionary,
                           out bufferedUtf8StringValue));
            }