| 174 | } |
| 175 | |
| 176 | JsonValue parse_binary(common::IInputStream &stream) { |
| 177 | KVBinaryStorageBlockHeader hdr; |
| 178 | hdr.m_signature_a = read_pod<uint32_t>(stream); |
| 179 | hdr.m_signature_b = read_pod<uint32_t>(stream); |
| 180 | stream.read(&hdr.m_ver, 1); |
| 181 | |
| 182 | if (hdr.m_signature_a != PORTABLE_STORAGE_SIGNATUREA || hdr.m_signature_b != PORTABLE_STORAGE_SIGNATUREB) |
| 183 | throw std::runtime_error("KVBinaryInputStream invalid binary storage signature"); |
| 184 | if (hdr.m_ver != PORTABLE_STORAGE_FORMAT_VER) |
| 185 | throw std::runtime_error("KVBinaryInputStream unknown binary storage format version"); |
| 186 | |
| 187 | return load_object(0, stream); |
| 188 | } |
| 189 | } // namespace |
| 190 | |
| 191 | KVBinaryInputStream::KVBinaryInputStream(common::IInputStream &strm) : JsonInputStreamValue(value_storage, true) { |
no test coverage detected