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

This class implements the input functionality of the `basic&lowbar;streambuf` protocol, using client&hyphen;supplied `char &ast;` memory&period;

== Synopsis

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

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

== Base Classes

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/2constructor.adoc[`FixedMemInStreamBuf`]         [.small]#[constructor]#
| Create a `FixedMemInStreamBuf` that provides access to the character sequence in the specified `buffer` of the specified `length`&period; The behavior is undefined unless `buffer !&equals; 0 &amp;&amp; length &gt; 0` or `length &equals;&equals; 0`&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/2destructor.adoc[`&#126;FixedMemInStreamBuf`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy this stream buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/data.adoc[`data`] 
| Return the address of the non&hyphen;modifiable character buffer held by this stream buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/length.adoc[`length`] 
| Return the number of characters from the current input position to the end of the stream buffer&period; The function returns the same value as `seekoff(0, bsl&colon;&colon;ios&lowbar;base&colon;&colon;beg)`&period; The length is modified by a call to `seekpos`, `seekoff` or by reading characters from the buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/pubsetbuf-03.adoc[`pubsetbuf`] 
| Reinitialize this stream buffer to use the specified character `buffer` having the specified `length`&period; Return the address of this modifiable stream buffer&period; The behavior is undefined unless `buffer !&equals; 0 &amp;&amp; length &gt; 0` or `length &equals;&equals; 0`&period; Upon reinitialization for use of the new buffer, neither the content nor the next input position indicator is preserved&period; Note that `buffer` is held but not owned&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/pubsetbuf-07.adoc[`pubsetbuf`] 
| Reinitialize this stream buffer to use the specified read&hyphen;only character `buffer` having the specified `length`&period;
|===


== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/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;in` or if the resulting absolute position is less than zero or greater than the value returned by `length`&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/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;in` or if position is less then zero or greater than the value returned by `length`&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/setbuf-09.adoc[`setbuf`]  [.small]#[virtual]#
| Reinitialize this stream buffer to use the specified character `buffer` having the specified `length`&period; Return the pointer providing modifiable access to this stream buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/setbuf-00.adoc[`setbuf`] 
| Reinitialize this stream buffer to use the specified character `buffer` having the specified `length`&period; Return the pointer providing modifiable access to this stream buffer&period; The behavior is undefined unless &grave;buffer !&equals; 0 &amp;&amp; length &gt; 0` or `length &equals;&equals; 0&grave;&period; Upon re&hyphen;initialization for use of the new buffer, neither the content nor the next input position indicator are preserved&period; Note that `buffer` is held but not owned&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/showmanyc.adoc[`showmanyc`]  [.small]#[virtual]#
| Return the number of characters currently available for reading from this stream buffer, or &hyphen;1 if there are none&period;
| xref:BloombergLP/bdlsb/FixedMemInStreamBuf/xsgetn.adoc[`xsgetn`]  [.small]#[virtual]#
| Read the specified `length` number of characters into the specified `destination`&period; Return the number of characters successfully read&period; The behavior is undefined unless `0 &lt;&equals; length`&period;
|===



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