| 145 | } |
| 146 | |
| 147 | int64_t GetLastFilePosition(std::streambuf& buffer) { |
| 148 | const auto pos = buffer.pubseekoff(0, std::ios_base::end); |
| 149 | if (pos < 0) { |
| 150 | throw std::ios_base::failure("Failed to get last stream position"); |
| 151 | } |
| 152 | return pos; |
| 153 | } |
| 154 | |
| 155 | void SetFilePosition(std::streambuf& buffer, int64_t position) { |
| 156 | const auto pos = buffer.pubseekpos( |