[#BloombergLP-baljsn-Decoder-decode-00]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/Decoder.adoc[Decoder]::decode
:relfileprefix: ../../../
:mrdocs:

Decode into the specified `value`, of a (template parameter) `TYPE`, the JSON data read from the specified `streamBuf` and using the specified `options`&period; Specifying a nullptr `options` is equivalent to passing a default&hyphen;constructed DecoderOptions in `options`&period; `TYPE` shall be a `bdeat`&hyphen;compatible sequence, choice, or array type, or a `bdeat`&hyphen;compatible dynamic type referring to one of those types&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; Note that this operation internally buffers input from `streambuf`, and if decoding is successful, will attempt to update the input position of `streambuf` to the last unprocessed byte&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;decoder&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
int
decode(
    std::streambuf* streamBuf,
    TYPE* value,
    xref:BloombergLP/baljsn/DecoderOptions.adoc[DecoderOptions] const& options);
----


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