MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ReadByte

Function ReadByte

lib/mdflib/mdflib/src/mdfblock.cpp:189–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189uint64_t ReadByte(std::streambuf& buffer,
190 std::vector<uint8_t> &dest,
191 uint64_t size) {
192 if (size == 0) {
193 dest.clear();
194 return 0;
195 }
196
197 dest.resize(static_cast<size_t>(size), 0);
198 const auto ret = buffer.sgetn(
199 reinterpret_cast<char*>(dest.data()),
200 static_cast<std::streamsize>(size));
201 if (ret != size) {
202 throw std::ios_base::failure("End of stream reached (EOF).");
203 }
204 return static_cast<uint64_t>(ret);
205}
206
207uint64_t WriteByte(std::streambuf& buffer, const std::vector<uint8_t> &source) {
208 const auto ret = buffer.sputn(

Callers 15

TESTFunction · 0.85
ReadMethod · 0.85
ReadDataMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85
ReadDataMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85
ReadMethod · 0.85

Calls 4

failureFunction · 0.85
clearMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by 1

TESTFunction · 0.68