[#BloombergLP-balber-BerUtil_StreambufUtil-getChars]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::xref:BloombergLP/balber/BerUtil_StreambufUtil.adoc[BerUtil&lowbar;StreambufUtil]::getChars
:relfileprefix: ../../../
:mrdocs:

Read the specified `bufferLength` number of bytes from the input sequence of the specified `streamBuf`, as if by a call to &grave;streamBuf&hyphen;&gt;sgetn(buffer&period;

== Synopsis

Declared in `&lt;balber&lowbar;berutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
getChars(
    char* buffer,
    std::streambuf* streamBuf,
    int bufferLength);
----

== Description

bufferLength)&grave;, and load the bytes into successive elements of the specified `buffer`, starting at the first element&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The operation succeeds if `length` bytes are successfully read from the input sequence of the `streamBuf` without the read position becoming unavailable&period; If less than `bufferLength` bytes are read, the number of bytes loaded into `buffer` is not specified&period; The behavior is undefined unless `0 &lt;&equals; bufferLength` and `buffer` is the address of a sequence of at least `bufferLength` bytes&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| destination byte buffer
| *streamBuf*
| input stream buffer
| *bufferLength*
| number of bytes to read
|===


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