[#BloombergLP-bslx-GenericOutStream-putLength] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslx.adoc[bslx]::xref:BloombergLP/bslx/GenericOutStream.adoc[GenericOutStream]::putLength :relfileprefix: ../../../ :mrdocs: If the specified `length` is less than 128, write to the stream supplied at construction the one‐byte integer comprised of the least‐significant one byte of the `length`; otherwise, write to the stream the four‐byte, two's complement integer (in network byte order) comprised of the least‐significant four bytes of the `length` (in host byte order) with the most‐significant bit set. Return a reference to this stream. If this stream is initially invalid, this operation has no effect. The behavior is undefined unless `0 <= length`. == Synopsis Declared in `<bslx_genericoutstream.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslx/GenericOutStream.adoc[GenericOutStream<STREAMBUF>]& putLength(int length); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#