| 757 | MemoryWriter(uint8_t* buf, size_t size) : Writer(), buf_(buf), size_(size), bytes_written_(0) {} |
| 758 | |
| 759 | virtual bool Append(uint8_t* buf, size_t buf_size) override { |
| 760 | if (bytes_written_ + buf_size > size_) { |
| 761 | //chensenhua ALOGW("Zip: Unexpected size " ZD " (declared) vs " ZD " (actual)", size_, |
| 762 | //chensenhua bytes_written_ + buf_size); |
| 763 | return false; |
| 764 | } |
| 765 | |
| 766 | memcpy(buf_ + bytes_written_, buf, buf_size); |
| 767 | bytes_written_ += buf_size; |
| 768 | return true; |
| 769 | } |
| 770 | |
| 771 | private: |
| 772 | uint8_t* const buf_; |
nothing calls this directly
no outgoing calls
no test coverage detected