| 148 | } |
| 149 | |
| 150 | void BufferedConnectionData::copyInto(uint8_t* buf, int count) { |
| 151 | uint8_t* ptr = buf; |
| 152 | int offset = buffer_begin_offset; |
| 153 | |
| 154 | auto it = buffer.begin(); |
| 155 | |
| 156 | int remaining = count; |
| 157 | |
| 158 | while (remaining) { |
| 159 | int to_copy = std::min(BCBlock::DATA_SIZE - offset, remaining); |
| 160 | memcpy(ptr, (*it)->data + offset, to_copy); |
| 161 | ++it; |
| 162 | offset = 0; |
| 163 | ptr += to_copy; |
| 164 | remaining -= to_copy; |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | StringRef BufferedConnection::peekExact(int count) { |
| 169 | ASSERT(count <= self->total_bytes.get()); |
no test coverage detected