MCPcopy Create free account
hub / github.com/apache/cloudberry / read

Method read

gpcontrib/gpcloud/test/decompress_reader_test.cpp:23–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 }
22
23 uint64_t read(char *buf, uint64_t count) {
24 uint64_t remaining = this->data.size() - offset;
25 if (remaining <= 0) {
26 return 0;
27 }
28
29 uint64_t size = (remaining > count) ? count : remaining;
30 size = size < this->chunkSize ? size : this->chunkSize;
31 for (uint64_t i = 0; i < size; i++) {
32 buf[i] = this->data[offset + i];
33 }
34
35 this->offset += size;
36 return size;
37 }
38
39 void clear() {
40 this->data.clear();

Callers 5

TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected