| Home | Libraries | People | FAQ | More

##### buffers_prefix (1 of 3 overloads)

Returns a prefix of a constant buffer.

###### Synopsis

Defined in header `<boost/beast/core/buffers_prefix.hpp>`

    boost::asio::const_buffer
    buffers_prefix(
        std::size_t size,
        boost::asio::const_buffer buffer);

###### Description

The returned buffer points to the same memory as the passed buffer, but with a size that is equal to or less than the size of the original buffer.

###### Parameters

Name | Description
--- | ---
`size` | The size of the returned buffer.
`buffer` | The buffer to shorten. The underlying memory is not modified.

###### Return Value

A new buffer that points to the first `size` bytes of the original buffer.

Convenience header `<boost/beast/core.hpp>`