[#btck-write_bytes]
= xref:btck.adoc[btck]::write&lowbar;bytes
:relfileprefix: ../
:mrdocs:

Serializes a C object into a byte vector using its `to&lowbar;bytes` callback&period;

== Synopsis

Declared in `&lt;kernel&sol;bitcoinkernel&lowbar;wrapper&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
std::vector&lt;std::byte&gt;
write&lowbar;bytes(
    T const* object,
    int(* to&lowbar;bytes)(T const*, xref:btck_WriteBytes.adoc[btck&lowbar;WriteBytes], void*));
----

== Return Value

The serialized bytes&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *object*
| The C object to serialize&period;
| *to&lowbar;bytes*
| The `btck&lowbar;&ast;&lowbar;to&lowbar;bytes` function that streams the object&apos;s bytes&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
