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

Provide a basic input stream buffer using client&hyphen;supplied memory&period;

== Synopsis

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

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

== Description

This class, like `bdlsb&colon;&colon;FixedMemInStreamBuf`, implements the input functionality of the `basic&lowbar;streambuf` interface, using client&hyphen;supplied `char &ast;` memory&period; It has an interface identical to `bdlsb&colon;&colon;FixedMemInStreamBuf` but does _not_ inherit from `bsl&colon;&colon;streambuf`&period; This implementation is advantageous for performance reasons, as the overhead of the initialization and virtual function calls of a `bsl&colon;&colon;streambuf` can be undesirable&period; It is especially designed for streaming a very small amount of information from a fixed&hyphen;length buffer using a `bslx&lowbar;genericinstream` when the number of characters read from the input is guaranteed not to exceed the length of the buffer&period; Note that this class is not designed to be derived from&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/FixedMemInput/char_type.adoc[`char&lowbar;type`] 
| This `typedef` is an alias to `char`&period;
| xref:BloombergLP/bdlsb/FixedMemInput/int_type.adoc[`int&lowbar;type`] 
| This `typedef` is an alias to `traits&lowbar;type&colon;&colon;int&lowbar;type`&period;
| xref:BloombergLP/bdlsb/FixedMemInput/off_type.adoc[`off&lowbar;type`] 
| This `typedef` is an alias to `traits&lowbar;type&colon;&colon;off&lowbar;type`&period;
| xref:BloombergLP/bdlsb/FixedMemInput/pos_type.adoc[`pos&lowbar;type`] 
| This `typedef` is an alias to `traits&lowbar;type&colon;&colon;pos&lowbar;type`&period;
| xref:BloombergLP/bdlsb/FixedMemInput/traits_type.adoc[`traits&lowbar;type`] 
| This `typedef` is an alias to `bsl&colon;&colon;char&lowbar;traits&lt;char&gt;`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlsb/FixedMemInput/2constructor.adoc[`FixedMemInput`]         [.small]#[constructor]#
| Create a `FixedMemInput` using the specified buffer and length&period;
| xref:BloombergLP/bdlsb/FixedMemInput/capacity.adoc[`capacity`] 
| Return the size for the buffer held by this buffer, in bytes, supplied at construction&period;
| xref:BloombergLP/bdlsb/FixedMemInput/data.adoc[`data`] 
| Return the address of the non&hyphen;modifiable character buffer held by this stream buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInput/in_avail.adoc[`in&lowbar;avail`] 
| Return the number of characters available from the current read position in this stream buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInput/length.adoc[`length`] 
| Return the number of characters remaining to be read&period;
| xref:BloombergLP/bdlsb/FixedMemInput/pubseekoff.adoc[`pubseekoff`] 
| Set the position indicator to a relative offset in this buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInput/pubseekpos.adoc[`pubseekpos`] 
| Set the position indicator to the specified absolute position&period;
| xref:BloombergLP/bdlsb/FixedMemInput/pubsetbuf.adoc[`pubsetbuf`] 
| Reinitialize this stream buffer to use the specified character buffer&period;
| xref:BloombergLP/bdlsb/FixedMemInput/sbumpc.adoc[`sbumpc`] 
| Return the character at the current read position and advance&period;
| xref:BloombergLP/bdlsb/FixedMemInput/sgetc.adoc[`sgetc`] 
| Return the character at the current read position from this buffer, or `traits&lowbar;type&colon;&colon;eof()` if the end of the buffer is reached&period;
| xref:BloombergLP/bdlsb/FixedMemInput/sgetn.adoc[`sgetn`] 
| Read characters from this buffer into the specified destination&period;
| xref:BloombergLP/bdlsb/FixedMemInput/snextc.adoc[`snextc`] 
| Advance the read position and return the next character&period;
| xref:BloombergLP/bdlsb/FixedMemInput/sputbackc.adoc[`sputbackc`] 
| Put back the specified character if it matches the previous character&period;
| xref:BloombergLP/bdlsb/FixedMemInput/sungetc.adoc[`sungetc`] 
| Move the read position back one character and return that character&period;
|===



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