recordio provides a interface to read/write multiple Protocol Buffers messages from/to a single binary file.
Forked from google/or-tools
See test.cc for an example
Person person; // a protobuf message
std::ofstream ofs("example.recordio", std::ios::binary);
recordio::RecordWriter writer(&ofs);
writer.WriteProtocolMessage(person);
writer.Close()
std::ifstream ifs("example.recordio", std::ios::binary);
recordio::RecordReader reader(&ifs);
Person person;
while (reader.ReadProtocolMessage(&person)) {
// do something
}
reader.Close();
- zlib
- protocol buffer
Apache License, Version 2.0 (see the codes for more details)