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

Method serialize_to

cpp/fory/serialization/fory.h:642–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640 /// @return Number of bytes written, or error.
641 template <typename T>
642 Result<size_t, Error> serialize_to(std::vector<uint8_t> &output,
643 const T &obj) {
644 // Wrap the output vector in a Buffer for zero-copy serialization
645 // writer_index starts at output.size() for appending
646 Buffer buffer(output);
647
648 // Forward to Buffer version
649 auto result = serialize_to(buffer, obj);
650
651 // Resize vector to actual written size
652 output.resize(buffer.writer_index());
653 return result;
654 }
655
656 /// Deserialize an object from a byte array.
657 ///

Callers 2

TESTFunction · 0.45
serialize_toMethod · 0.45

Calls 2

writer_indexMethod · 0.80
resizeMethod · 0.45

Tested by 1

TESTFunction · 0.36