[#BloombergLP-bdls-FdStreamBuf-xsgetn]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FdStreamBuf.adoc[FdStreamBuf]::xsgetn
:relfileprefix: ../../../
:mrdocs:

Read up to `numBytes` characters into `buffer`&period;

== Synopsis

Declared in `&lt;bdls&lowbar;fdstreambuf&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
std::streamsize
xsgetn(
    char* buffer,
    std::streamsize numBytes) override;
----

== Description

Read up to the specified `numBytes` characters from the file descriptor into the specified `buffer` and return the number of characters successfully read&period; The behavior is undefined unless `buffer` is at least `numBytes` bytes long&period; Note that on a Windows text file, a &grave;&bsol;r ` in the file will be read as `
&grave; (counting as a single character)&period;

== Return Value

the number of characters successfully read

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| destination for characters read
| *numBytes*
| maximum number of characters to read
|===


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