[#bsl-basic_istringstream-readsome-00]
= xref:bsl.adoc[bsl]::xref:bsl/basic_istringstream.adoc[basic&lowbar;istringstream]::readsome
:relfileprefix: ../../
:mrdocs:

Extraction until the buffer is exhausted, but no more&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
streamsize
readsome(
    char&lowbar;type* &lowbar;&lowbar;s,
    streamsize &lowbar;&lowbar;n);
----

== Description

Extracts characters and stores them into _&lowbar;&lowbar;s_ depending on the number of characters remaining in the streambuf&apos;s buffer, `rdbuf()&hyphen;&gt;in&lowbar;avail(),` called `A` here&colon;

* if `A` `&equals;&equals;` `&hyphen;1,` sets eofbit and extracts no characters
* if `A` `&equals;&equals;` `0,` extracts no characters
* if `A` `&gt;` `0,` extracts `min(A,n)`

The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf&period;

== Return Value

The number of characters extracted&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *&lowbar;&lowbar;s*
| A character array&period;
| *&lowbar;&lowbar;n*
| Maximum number of characters to store&period;
|===


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