MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / write

Method write

Source/external/hps/buffer/stream_output_buffer.h:16–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 StreamOutputBuffer(std::ostream& stream) : stream(&stream) { pos = 0; }
15
16 void write(const char* content, size_t length) {
17 if (pos + length > STREAM_OUTPUT_BUFFER_SIZE) {
18 const size_t n_avail = STREAM_OUTPUT_BUFFER_SIZE - pos;
19 write_core(content, n_avail);
20 length -= n_avail;
21 content += n_avail;
22 flush();
23 if (length > STREAM_OUTPUT_BUFFER_SIZE) {
24 stream->write(content, length);
25 return;
26 }
27 }
28 write_core(content, length);
29 }
30
31 void write_char(const char ch) {
32 if (pos == STREAM_OUTPUT_BUFFER_SIZE) {

Callers 6

serializeMethod · 0.45
serializeMethod · 0.45
flushMethod · 0.45
serializeMethod · 0.45
serializeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected