MCPcopy Create free account
hub / github.com/ByConity/ByConity / finishImpl

Method finishImpl

src/IO/ZstdDeflatingWriteBuffer.cpp:138–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void ZstdDeflatingWriteBuffer::finishImpl()
139{
140 next();
141
142 out->nextIfAtEnd();
143
144 input.src = reinterpret_cast<unsigned char *>(working_buffer.begin());
145 input.size = offset();
146 input.pos = 0;
147
148 output.dst = reinterpret_cast<unsigned char *>(out->buffer().begin());
149 output.size = out->buffer().size();
150 output.pos = out->offset();
151
152 size_t remaining = ZSTD_compressStream2(cctx, &output, &input, ZSTD_e_end);
153 if (ZSTD_isError(remaining))
154 throw Exception(ErrorCodes::ZSTD_ENCODER_FAILED, "zstd stream encoder end failed: zstd version: {}", ZSTD_VERSION_STRING);
155 out->position() = out->buffer().begin() + output.pos;
156}
157
158}

Callers

nothing calls this directly

Calls 7

bufferMethod · 0.80
ExceptionClass · 0.50
nextIfAtEndMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45
offsetMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected