MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / findChunk

Method findChunk

lib/fluxsource/a2rfluxsource.cc:172–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171private:
172 Bytes findChunk(Bytes id)
173 {
174 uint32_t offset = 8;
175 while (offset < _data.size())
176 {
177 ByteReader br(_data);
178 br.seek(offset);
179 if (br.read(4) == id)
180 {
181 uint32_t size = br.read_le32();
182 return br.read(size);
183 }
184
185 offset += br.read_le32() + 8;
186 }
187
188 error("A2R file missing chunk");
189 }
190
191private:
192 const A2rFluxSourceProto& _config;

Callers

nothing calls this directly

Calls 5

errorFunction · 0.85
read_le32Method · 0.80
sizeMethod · 0.45
seekMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected