[#BloombergLP-bdlsb-OverflowMemOutStreamBuf]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlsb.adoc[bdlsb]::OverflowMemOutStreamBuf
:relfileprefix: ../../
:mrdocs:

This class implements the output functionality of the `bsl&colon;&colon;basic&lowbar;streambuf` protocol, using client&hyphen;supplied memory and client&hyphen;supplied allocator if additional memory is needed&period;

== Synopsis

Declared in `&lt;bdlsb&lowbar;overflowmemoutstreambuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class OverflowMemOutStreamBuf
    : public std::streambuf
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `std::streambuf`
| 
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/2constructor.adoc[`OverflowMemOutStreamBuf`]         [.small]#[constructor]#
| Create an empty stream buffer that uses the specified `buffer` as an initial output buffer of the specified `size` (in bytes)&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently&hyphen;installed default allocator is used&period; The behavior is undefined unless `buffer` points to a valid sequence of positive `size` characters&period; Note that this stream buffer does not assume ownership of `buffer`&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/2destructor.adoc[`&#126;OverflowMemOutStreamBuf`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this stream buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/dataLength.adoc[`dataLength`] 
| Return the number of bytes written to this stream&period; Note that if `pptr()` is currently pointing into the overflow buffer the data length will be greater than the size of the initial buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/dataLengthInInitialBuffer.adoc[`dataLengthInInitialBuffer`] 
| Return the length of data in the initial buffer, i&period;e&period;, `dataLength()` if there is no overflow buffer, or `initialBufferSize()` if there is one&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/dataLengthInOverflowBuffer.adoc[`dataLengthInOverflowBuffer`] 
| Return the length of the data in the overflow buffer, i&period;e&period;, 0 if there is no overflow buffer, or `dataLength() &hyphen; initialBufferSize()` if there is one&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/initialBuffer.adoc[`initialBuffer`] 
| Return a pointer to the non&hyphen;modifiable buffer supplied at construction&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/initialBufferSize.adoc[`initialBufferSize`] 
| Return the size of the buffer supplied at construction&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/overflowBuffer.adoc[`overflowBuffer`] 
| Return a pointer to the non&hyphen;modifiable overflow buffer if there is one, or 0 otherwise&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/overflowBufferSize.adoc[`overflowBufferSize`] 
| Return the size of the overflow buffer, or 0 if there is no overflow buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;OverflowMemOutStreamBuf, UsesBslmaAllocator&gt;`] 
| 
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/overflow.adoc[`overflow`]  [.small]#[virtual]#
| If c is not `EOF`, adjust the underlying buffer so that the next put position is valid, put the specified `c` at this position, and increment the put position&period; Return `c` on success, and `traits&lowbar;type&colon;&colon;not&lowbar;eof(c)` if `c` is `EOF`&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/seekoff.adoc[`seekoff`]  [.small]#[virtual]#
| Set the position indicator to the relative specified `offset` from the base position indicated by the specified `way` and return the resulting absolute position on success or pos&lowbar;type(&hyphen;1) on failure&period; Optionally specify `which` area of the stream buffer&period; The seek operation will fail if `which` does not include the flag `bsl&colon;&colon;ios&lowbar;base&colon;&colon;out` or if the resulting absolute position is negative&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/seekpos.adoc[`seekpos`]  [.small]#[virtual]#
| Set the position indicator to the specified `position` and return the resulting absolute position on success or pos&lowbar;type(&hyphen;1) on failure&period; Optionally specify `which` area of the stream buffer&period; The `seekpos` operation will fail if `which` does not include the flag `bsl&colon;&colon;ios&lowbar;base&colon;&colon;out` or if `position` is negative&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/sync.adoc[`sync`]  [.small]#[virtual]#
| Set `d&lowbar;dataLength` to the amount of data that has been written to this stream buffer, from the beginning of the stream to the current `pptr()` position and return 0&period; Note that if `pptr()` points into the overflow buffer, this size the initial buffer, plus the portion of the overflow buffer that has been written to&period;
| xref:BloombergLP/bdlsb/OverflowMemOutStreamBuf/xsputn.adoc[`xsputn`]  [.small]#[virtual]#
| Write the specified `numChars` characters from the specified `source` to the stream buffer&period; Return the number of characters successfully written&period; The behavior is undefined unless &apos;(source &amp;&amp; 0 &lt; numChars) &verbar;&verbar; 0 &equals;&equals; numChars&apos;&period;
|===



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