| 1033 | } |
| 1034 | |
| 1035 | bool SerializerService::serializeGenomeToString(std::string& output, std::vector<uint8_t> const& input) |
| 1036 | { |
| 1037 | try { |
| 1038 | std::stringstream stdStream; |
| 1039 | zstr::ostream stream(stdStream, std::ios::binary); |
| 1040 | if (!stream) { |
| 1041 | return false; |
| 1042 | } |
| 1043 | |
| 1044 | ClusteredDataDescription data; |
| 1045 | if (!wrapGenome(data, input)) { |
| 1046 | return false; |
| 1047 | } |
| 1048 | |
| 1049 | serializeDataDescription(data, stream); |
| 1050 | stream.flush(); |
| 1051 | output = stdStream.str(); |
| 1052 | return true; |
| 1053 | } catch (...) { |
| 1054 | return false; |
| 1055 | } |
| 1056 | } |
| 1057 | |
| 1058 | bool SerializerService::deserializeGenomeFromString(std::vector<uint8_t>& output, std::string const& input) |
| 1059 | { |