private static ResultRow DeserializeRow(FastSerializableKeys <string> keys, ReadOnlySequence <byte> line) { var fields = new FastSerializableDictionary <string, object>(keys); var reader = new Utf8JsonReader(line); var foundStart = false; while (reader.Read()) { if (!foundStart) { if (reader.TokenType != JsonTokenType.StartObject) { throw new FormatException(); } foundStart = true; continue; } if (reader.TokenType == JsonTokenType.EndObject) { if (reader.BytesConsumed != line.Length) { throw new FormatException(); } break; } if (reader.TokenType != JsonTokenType.PropertyName) { throw new ArgumentOutOfRangeException(); } var key = reader.GetString(); if (!reader.Read()) { throw new FormatException(); } fields[key] = reader.FastReadObject <object>(); } return(new ResultRow(fields)); }
private static ResultRow DeserializeRow(FastSerializableKeys <string> keys, ReadOnlySequence <byte> line) { var fields = FastSerializableDictionary <string, object> .Deserialize(keys, line); return(new ResultRow(fields)); }