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

This component&hyphen;private utility `struct` provides a namespace for a suite of functions used by `BerUtil` to perform input and output operations on `bsl&colon;&colon;streambuf` objects&period; Note that these functions are intended to adapt the standard stream&hyphen;buffer operations to a BDE&hyphen;style interface&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct BerUtil&lowbar;StreambufUtil;
----

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_StreambufUtil/getChars.adoc[`getChars`] 
| Read the specified `bufferLength` number of bytes from the input sequence of the specified `streamBuf`, as if by a call to `streamBuf&hyphen;&gt;sgetn(buffer, bufferLength)`, 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;
| xref:BloombergLP/balber/BerUtil_StreambufUtil/peekChar.adoc[`peekChar`] 
| Read the next byte from the specified `streamBuf` without advancing the read position and load that byte into the specified `value`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; If this operation is not successful, the value of `&ast;value` is unchanged&period; This operation fails if the input sequence of `streamBuf` is at its end&period;
| xref:BloombergLP/balber/BerUtil_StreambufUtil/putChars.adoc[`putChars`] 
| Write the first specified `bufferLength` number of bytes from the specified `buffer` to the specified `streamBuf`, as if by a call to `streamBuf&hyphen;&gt;sputn(buffer, bufferLength)`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period;
|===



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