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

This class, like `bdlsb&colon;&colon;OverflowMemOutStreamBuf`, implements the output functionality of the `bsl&colon;&colon;basic&lowbar;streambuf` interface, using a client&hyphen;supplied buffer and allocator&hyphen;supplied overflow buffer if additional memory is needed&period; It has an interface similar to `bdlsb&colon;&colon;OverflowMemOutStreamBuf` but does *not* inherit from `bsl&colon;&colon;streambuf`&period; Thus, it is suitable for use as template parameter to `bslx&colon;&colon;GenericByteOutStream` (but not to `bslx&colon;&colon;ByteOutStream` or `bslx&colon;&colon;ByteOutStreamFormatter`)&period; Note that this class is not designed to be derived from&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class OverflowMemOutput;
----

== Type Aliases

[cols="1"]
|===
| Name
| xref:BloombergLP/bdlsb/OverflowMemOutput/char_type.adoc[`char&lowbar;type`] 
| xref:BloombergLP/bdlsb/OverflowMemOutput/int_type.adoc[`int&lowbar;type`] 
| xref:BloombergLP/bdlsb/OverflowMemOutput/off_type.adoc[`off&lowbar;type`] 
| xref:BloombergLP/bdlsb/OverflowMemOutput/pos_type.adoc[`pos&lowbar;type`] 
| xref:BloombergLP/bdlsb/OverflowMemOutput/traits_type.adoc[`traits&lowbar;type`] 
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/OverflowMemOutput/2constructor.adoc[`OverflowMemOutput`]         [.small]#[constructor]#
| Create an `OverflowMemOutput` using the specified `buffer` of the specified `length` as the initial output buffer&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `buffer !&equals; 0 &amp;&amp; length &gt; 0`&period; Note that this stream buffer does not assume ownership of `buffer`&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/2destructor.adoc[`&#126;OverflowMemOutput`] [.small]#[destructor]#
| Destroy this stream buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/dataLength.adoc[`dataLength`] 
| Return the number of bytes that have been written to this object&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/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/OverflowMemOutput/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/OverflowMemOutput/initialBuffer.adoc[`initialBuffer`] 
| Return a pointer providing non&hyphen;modifiable access to the character buffer held by this stream buffer (specified at construction)&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/initialBufferSize.adoc[`initialBufferSize`] 
| Return the size of the initial buffer held by this stream buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/overflowBuffer.adoc[`overflowBuffer`] 
| Return a pointer providing non&hyphen;modifiable access to the overflow buffer if there is one, or 0 otherwise&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/overflowBufferSize.adoc[`overflowBufferSize`] 
| Return the size of the overflow buffer, or 0 if there is no overflow buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/pubseekoff.adoc[`pubseekoff`] 
| 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 less than zero&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/pubseekpos.adoc[`pubseekpos`] 
| 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 less then zero&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/pubsetbuf.adoc[`pubsetbuf`] 
| Reinitialize this stream buffer to use the specified character `buffer` having the specified `length`&period; Return a pointer providing modifiable access to this stream buffer&period; This stream buffer does not support reinitialization of the internal character buffer&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/pubsync.adoc[`pubsync`] 
| Synchronize this stream buffer with associated character sequence&period; Operation has no effect&period; Return `0` unconditionally&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/sputc.adoc[`sputc`] 
| Write the specified character `c` at the current write position and advance write position of this buffer&period; Return `c`, or `traits&lowbar;type&colon;&colon;eof()` if the end of the write buffer is reached&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/sputn.adoc[`sputn`] 
| Write the specified `length` characters from the specified `source` to this buffer&period; Return the number of characters written, which is either `length` or the distance from the current write position to the end of the write buffer, whichever is smaller, and move the write cursor position by this amount&period; The behaviour is undefined unless `source !&equals; 0 &verbar;&verbar; length &gt; 0`&period;
| xref:BloombergLP/bdlsb/OverflowMemOutput/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;OverflowMemOutput, UsesBslmaAllocator&gt;`] 
| 
|===



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