[#bsl-basic_stringbuf-xsgetn-01]
= xref:bsl.adoc[bsl]::xref:bsl/basic_stringbuf.adoc[basic&lowbar;stringbuf]::xsgetn
:relfileprefix: ../../
:mrdocs:

Read characters from the input sequence&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringbuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
std::streamsize
xsgetn(
    xref:bsl/basic_stringbuf/char_type.adoc[char&lowbar;type]* result,
    std::streamsize numCharacters);
----

== Description

Read up to the specified `numCharacters` from this `stringbuf` object and store them in the specified `result` array&period; Return the number of characters loaded into `result`&period; Note that if fewer than `numCharacters` characters are available in the buffer, all available characters are loaded into `result`&period; The behavior is undefined unless `result` refers to a contiguous sequence of at least `numCharacters` characters&period;

== Return Value

number of characters loaded into `result`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| destination array for characters read from the buffer
| *numCharacters*
| maximum number of characters to read
|===


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