| 85 | } |
| 86 | |
| 87 | void compress(const char *inbuf) |
| 88 | { |
| 89 | // First time through. |
| 90 | if (!m_compressor) |
| 91 | { |
| 92 | // Get the position |
| 93 | m_chunkInfoPos = m_stream.tellp(); |
| 94 | // Seek over the chunk info offset value |
| 95 | m_stream.seekp(sizeof(uint64_t), std::ios::cur); |
| 96 | m_chunkOffset = m_stream.tellp(); |
| 97 | resetCompressor(); |
| 98 | } |
| 99 | else if (m_chunkPointsWritten == m_chunksize) |
| 100 | { |
| 101 | resetCompressor(); |
| 102 | newChunk(); |
| 103 | } |
| 104 | m_compressor->compress(inbuf); |
| 105 | m_chunkPointsWritten++; |
| 106 | } |
| 107 | |
| 108 | void done() |
| 109 | { |