MCPcopy Create free account
hub / github.com/apache/arrow / Decompress

Method Decompress

cpp/src/arrow/util/compression_lz4.cc:104–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 Result<DecompressResult> Decompress(int64_t input_len, const uint8_t* input,
105 int64_t output_len, uint8_t* output) override {
106 auto src = input;
107 auto dst = output;
108 auto src_size = static_cast<size_t>(input_len);
109 auto dst_capacity = static_cast<size_t>(output_len);
110 size_t ret;
111
112 DCHECK_NE(src, nullptr);
113 ret =
114 LZ4F_decompress(ctx_, dst, &dst_capacity, src, &src_size, nullptr /* options */);
115 if (LZ4F_isError(ret)) {
116 return LZ4Error(ret, "LZ4 decompress failed: ");
117 }
118 finished_ = (ret == 0);
119 return DecompressResult{static_cast<int64_t>(src_size),
120 static_cast<int64_t>(dst_capacity),
121 (src_size == 0 && dst_capacity == 0)};
122 }
123
124 bool IsFinished() override { return finished_; }
125

Callers

nothing calls this directly

Calls 1

LZ4ErrorFunction · 0.85

Tested by

no test coverage detected