MCPcopy Create free account
hub / github.com/ElementsProject/elements / Read

Method Read

src/leveldb/table/table_test.cc:119–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117 uint64_t Size() const { return contents_.size(); }
118
119 Status Read(uint64_t offset, size_t n, Slice* result,
120 char* scratch) const override {
121 if (offset >= contents_.size()) {
122 return Status::InvalidArgument("invalid Read offset");
123 }
124 if (offset + n > contents_.size()) {
125 n = contents_.size() - offset;
126 }
127 memcpy(scratch, &contents_[offset], n);
128 *result = Slice(scratch, n);
129 return Status::OK();
130 }
131
132 std::string GetName() const { return ""; }
133 private:

Callers 2

OpenMethod · 0.45
ReadBlockFunction · 0.45

Calls 4

InvalidArgumentFunction · 0.85
OKFunction · 0.85
SliceClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected