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

Function CompressDataOneShot

cpp/src/arrow/io/compressed_test.cc:72–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72std::shared_ptr<Buffer> CompressDataOneShot(Codec* codec,
73 const std::vector<uint8_t>& data) {
74 int64_t max_compressed_len, compressed_len;
75 max_compressed_len = codec->MaxCompressedLen(data.size(), data.data());
76 auto compressed = *AllocateResizableBuffer(max_compressed_len);
77 compressed_len = *codec->Compress(data.size(), data.data(), max_compressed_len,
78 compressed->mutable_data());
79 ABORT_NOT_OK(compressed->Resize(compressed_len));
80 return compressed;
81}
82
83Status RunCompressedInputStream(Codec* codec, std::shared_ptr<Buffer> compressed,
84 int64_t* stream_pos, std::vector<uint8_t>* out) {

Callers 2

TEST_PFunction · 0.85

Calls 7

AllocateResizableBufferFunction · 0.85
MaxCompressedLenMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
CompressMethod · 0.45
mutable_dataMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected