| 14 | } |
| 15 | |
| 16 | uint32_t MemoryBuffer::GetData(int64_t offset, uint8_t* buffer, uint32_t count) { |
| 17 | if (offset >= GetSize()) |
| 18 | return 0; |
| 19 | if (count + offset > GetSize()) |
| 20 | count = uint32_t(GetSize() - offset); |
| 21 | ::memcpy(buffer, _buffer.data() + offset, count); |
| 22 | return count; |
| 23 | } |
| 24 | |
| 25 | bool MemoryBuffer::Insert(int64_t offset, const uint8_t* data, uint32_t count) { |
| 26 | _buffer.insert(_buffer.begin() + offset, data, data + count); |
no outgoing calls
no test coverage detected