MCPcopy Create free account
hub / github.com/bcndev/bytecoin / parse_binary

Function parse_binary

src/seria/KVBinaryInputStream.cpp:176–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176JsonValue 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
191KVBinaryInputStream::KVBinaryInputStream(common::IInputStream &strm) : JsonInputStreamValue(value_storage, true) {

Callers 1

KVBinaryInputStreamMethod · 0.85

Calls 2

load_objectFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected