MCPcopy Create free account
hub / github.com/bcndev/bytecoin / write

Method write

src/common/Streams.cpp:22–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void 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
32static const size_t CHUNK = 1024 * 1024;
33// We read sized entities in chunks to prevent over-sized allocation attacks

Callers 1

Words_generate.pyFile · 0.45

Calls 4

StreamErrorClass · 0.85
writeFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected