[#BloombergLP-baljsn-Encoder-encode-0ea] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Encoder.adoc[Encoder]::encode :relfileprefix: ../../../ :mrdocs: Encode the specified `value` of (template parameter) `TYPE` into the specified `streamBuf`. Return 0 on success, and a non‐zero value otherwise. == Synopsis Declared in `<baljsn_encoder.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> int encode( std::streambuf* streamBuf, TYPE const& value); ---- == Description DEPRECATED: Use the `encode` function passed a reference to a non‐modifiable `EncoderOptions` object instead. [.small]#Created with https://www.mrdocs.com[MrDocs]#