| 20 | } |
| 21 | |
| 22 | void IOutputStream::write(const void *data, size_t size) { |
| 23 | while (size != 0) { |
| 24 | size_t wc = write_some(data, size); |
| 25 | if (wc == 0) |
| 26 | throw StreamError("IOutputStream error writing to full stream"); |
| 27 | data = reinterpret_cast<const char *>(data) + wc; |
| 28 | size -= wc; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | static const size_t CHUNK = 1024 * 1024; |
| 33 | // We read sized entities in chunks to prevent over-sized allocation attacks |
no test coverage detected