MCPcopy Create free account
hub / github.com/apache/fory / write_bytes

Method write_bytes

cpp/fory/util/buffer.h:851–858  ·  view source on GitHub ↗

write raw bytes to buffer at current writer index. Automatically grows buffer and advances writer index.

Source from the content-addressed store, hash-verified

849 /// write raw bytes to buffer at current writer index.
850 /// Automatically grows buffer and advances writer index.
851 FORY_ALWAYS_INLINE void write_bytes(const void *data, uint32_t length) {
852 grow(length);
853 unsafe_put(writer_index_, data, length);
854 increase_writer_index(length);
855 if (FORY_PREDICT_FALSE(output_stream_ != nullptr && writer_index_ > 4096)) {
856 output_stream_->try_flush();
857 }
858 }
859
860 // ===========================================================================
861 // Safe read methods with bounds checking

Callers 3

test_bufferFunction · 0.95
test_growFunction · 0.95
TESTFunction · 0.45

Calls 1

try_flushMethod · 0.45

Tested by 3

test_bufferFunction · 0.76
test_growFunction · 0.76
TESTFunction · 0.36