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

Read characters from this buffer into the specified destination&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::streamsize
sgetn(
    xref:BloombergLP/bdlsb/FixedMemInput/char_type.adoc[char&lowbar;type]* destination,
    std::streamsize length);
----

== Description

Read the specified `length` characters to the specified `destination`&period; Return the number of characters successfully read from this buffer, which is either equal to the `length` parameter or equal to the distance from the current read position to the end of the input buffer, whichever is smaller, and move the read cursor position by this amount&period; The behavior is undefined unless &apos;0 &lt;&equals; length&apos;&period;

== Return Value

number of characters successfully read

== Parameters

[cols="1,4"]
|===
| Name| Description
| *destination*
| buffer that receives the characters read
| *length*
| maximum number of characters to read
|===


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