[#BloombergLP-bslx-ByteOutStream] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslx.adoc[bslx]::ByteOutStream :relfileprefix: ../../ :mrdocs: Provide a BDEX output stream that externalizes values to a byte buffer. == Synopsis Declared in `<bslx_byteoutstream.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ByteOutStream; ---- == Description This class provides output methods to externalize values, and C‐style arrays of values, of the fundamental integral and floating‐point types, as well as `bsl::string` values. In particular, each `put` method of this class is guaranteed to write stream data that can be read by the corresponding `get` method of `bslx::ByteInStream`. See the `bslx` package‐level documentation for the definition of the BDEX `OutStream` protocol. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslx/ByteOutStream/2constructor-074.adoc[`ByteOutStream`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslx/ByteOutStream/2destructor.adoc[`~ByteOutStream`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bslx/ByteOutStream/bdexVersionSelector.adoc[`bdexVersionSelector`] | Return the `versionSelector` to be used with `operator<<` for BDEX streaming as per the `bslx` package‐level documentation. | xref:BloombergLP/bslx/ByteOutStream/data.adoc[`data`] | Return the address of this stream's contiguous internal buffer. | xref:BloombergLP/bslx/ByteOutStream/invalidate.adoc[`invalidate`] | Put this output stream in an invalid state. This function has no effect if this stream is already invalid. | xref:BloombergLP/bslx/ByteOutStream/isValid.adoc[`isValid`] | Return `true` if this stream is valid, and `false` otherwise. | xref:BloombergLP/bslx/ByteOutStream/length.adoc[`length`] | Return the number of bytes in this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayFloat32.adoc[`putArrayFloat32`] | Write an array of four‐byte IEEE single‐precision values to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayFloat64.adoc[`putArrayFloat64`] | Write an array of eight‐byte IEEE double‐precision values to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt16.adoc[`putArrayInt16`] | Write an array of two‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt24.adoc[`putArrayInt24`] | Write an array of three‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt32.adoc[`putArrayInt32`] | Write an array of four‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt40.adoc[`putArrayInt40`] | Write an array of five‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt48.adoc[`putArrayInt48`] | Write an array of six‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt56.adoc[`putArrayInt56`] | Write an array of seven‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt64.adoc[`putArrayInt64`] | Write an array of eight‐byte signed integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayInt8-0b.adoc[`putArrayInt8`] | `putArrayInt8` overloads | xref:BloombergLP/bslx/ByteOutStream/putArrayUint16.adoc[`putArrayUint16`] | Write an array of two‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint24.adoc[`putArrayUint24`] | Write an array of three‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint32.adoc[`putArrayUint32`] | Write an array of four‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint40.adoc[`putArrayUint40`] | Write an array of five‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint48.adoc[`putArrayUint48`] | Write an array of six‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint56.adoc[`putArrayUint56`] | Write an array of seven‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint64.adoc[`putArrayUint64`] | Write an array of eight‐byte unsigned integers to this stream. | xref:BloombergLP/bslx/ByteOutStream/putArrayUint8-0e.adoc[`putArrayUint8`] | `putArrayUint8` overloads | xref:BloombergLP/bslx/ByteOutStream/putFloat32.adoc[`putFloat32`] | Write a four‐byte IEEE single‐precision value to this stream. | xref:BloombergLP/bslx/ByteOutStream/putFloat64.adoc[`putFloat64`] | Write an eight‐byte IEEE double‐precision value to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt16.adoc[`putInt16`] | Write a two‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt24.adoc[`putInt24`] | Write a three‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt32.adoc[`putInt32`] | Write a four‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt40.adoc[`putInt40`] | Write a five‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt48.adoc[`putInt48`] | Write a six‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt56.adoc[`putInt56`] | Write a seven‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt64.adoc[`putInt64`] | Write an eight‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putInt8.adoc[`putInt8`] | Write a one‐byte signed integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putLength.adoc[`putLength`] | Write the specified `length` to this stream using BDEX length encoding. | xref:BloombergLP/bslx/ByteOutStream/putString.adoc[`putString`] | Write the length and characters of the specified `value` to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint16.adoc[`putUint16`] | Write a two‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint24.adoc[`putUint24`] | Write a three‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint32.adoc[`putUint32`] | Write a four‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint40.adoc[`putUint40`] | Write a five‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint48.adoc[`putUint48`] | Write a six‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint56.adoc[`putUint56`] | Write a seven‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint64.adoc[`putUint64`] | Write an eight‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putUint8.adoc[`putUint8`] | Write a one‐byte unsigned integer to this stream. | xref:BloombergLP/bslx/ByteOutStream/putVersion.adoc[`putVersion`] | Write the specified one‐byte `version` to this stream. | xref:BloombergLP/bslx/ByteOutStream/reserveCapacity.adoc[`reserveCapacity`] | Set the internal buffer size of this stream to be at least the specified `newCapacity` (in bytes). | xref:BloombergLP/bslx/ByteOutStream/reset.adoc[`reset`] | Remove all content in this stream and validate this stream if it is currently invalid. | xref:BloombergLP/bslx/ByteOutStream/2conversion.adoc[`operator void const*`] | Return a non‐null pointer if this stream is valid, and null otherwise. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslx/operator_lshift-0f5.adoc[BloombergLP::bslx::operator<<]` | Write the specified `object` to the specified output `stream` in some reasonable (multi‐line) format, and return a reference to `stream`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslx/operator_lshift-0fc.adoc[`operator<<`] | Write the BDEX‐compliant `value` to the specified output `stream`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#