Use buffer of capacity numBytes as this object's I/O buffer.

Synopsis

Declared in <bdls_fdstreambuf.h>

virtual
FdStreamBuf*
setbuf(
    char_type* buffer,
    std::streamsize numBytes) override;

Description

Use the specified buffer of the specified numBytes capacity as the input/output buffer for this streambuf. If buffer == 0, the buffer is dynamically allocated with a default size. If both buffer and numBytes are zero a 1‐byte buffer is dynamically allocated. The behavior is undefined if any I/O has preceded this call, and unless the buffer is uninitialized before this call.

Return Value

a pointer to this stream buffer

Parameters

Name

Description

buffer

buffer to use, or null to allocate dynamically

numBytes

capacity of buffer, or 0 for a default size

Created with MrDocs