| 154 | } |
| 155 | |
| 156 | JsonValue load_array(size_t level, common::IInputStream &stream, uint8_t item_type) { |
| 157 | JsonValue arr(JsonValue::ARRAY); |
| 158 | size_t count = read_kv_varint(stream); |
| 159 | |
| 160 | while (count--) { |
| 161 | if (item_type == BIN_KV_SERIALIZE_TYPE_ARRAY) { |
| 162 | uint8_t type; |
| 163 | stream.read(&type, 1); |
| 164 | if ((type & BIN_KV_SERIALIZE_FLAG_ARRAY) == 0) |
| 165 | throw std::runtime_error("KVBinaryInputStream Incorrect array of array encoding"); |
| 166 | type &= ~BIN_KV_SERIALIZE_FLAG_ARRAY; |
| 167 | |
| 168 | arr.push_back(load_array(level + 1, stream, type)); |
| 169 | } else |
| 170 | arr.push_back(load_value(level, stream, item_type)); |
| 171 | } |
| 172 | |
| 173 | return arr; |
| 174 | } |
| 175 | |
| 176 | JsonValue parse_binary(common::IInputStream &stream) { |
| 177 | KVBinaryStorageBlockHeader hdr; |
no test coverage detected