[#BloombergLP-bslx-TestOutStream-putLength] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslx.adoc[bslx]::xref:BloombergLP/bslx/TestOutStream.adoc[TestOutStream]::putLength :relfileprefix: ../../../ :mrdocs: If the specified `length` is less than 128, write to this stream the one‐byte type indicator for a one‐byte integer and the one‐byte integer comprised of the least‐significant one byte of the `length`; otherwise, write to this stream the one‐byte type indicator for a four‐byte integer and 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. If the next output operation has been set to be marked invalid (see `makeNextInvalid`), reset this marking and emit the invalid indicator instead of the type indicator. The behavior is undefined unless `0 <= length`. == Synopsis Declared in `<bslx_testoutstream.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslx/TestOutStream.adoc[TestOutStream]& putLength(int length); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#