| Home | Libraries | People | FAQ | More

### write

The `write` function is a composed operation that writes a certain amount of data to a stream before returning.

Write all of the supplied data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename ConstBufferSequence>
    std::size_t write(
        SyncWriteStream & s,
        const ConstBufferSequence & buffers,
        constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename ConstBufferSequence>
    std::size_t write(
        SyncWriteStream & s,
        const ConstBufferSequence & buffers,
        boost::system::error_code & ec,
        constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value >  = 0);
      » more...

Write a certain amount of data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename ConstBufferSequence,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        const ConstBufferSequence & buffers,
        CompletionCondition completion_condition,
        constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename ConstBufferSequence,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        const ConstBufferSequence & buffers,
        CompletionCondition completion_condition,
        boost::system::error_code & ec,
        constraint_t< is_const_buffer_sequence< ConstBufferSequence >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

Write all of the supplied data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v1>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v1 && buffers,
        constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v1>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v1 && buffers,
        boost::system::error_code & ec,
        constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value >  = 0);
      » more...

Write a certain amount of data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v1,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v1 && buffers,
        CompletionCondition completion_condition,
        constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v1,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v1 && buffers,
        CompletionCondition completion_condition,
        boost::system::error_code & ec,
        constraint_t< is_dynamic_buffer_v1< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< !is_dynamic_buffer_v2< decay_t< DynamicBuffer_v1 > >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

Write all of the supplied data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename Allocator>
    std::size_t write(
        SyncWriteStream & s,
        basic_streambuf< Allocator > & b);
      » more...

    template<
        typename SyncWriteStream,
        typename Allocator>
    std::size_t write(
        SyncWriteStream & s,
        basic_streambuf< Allocator > & b,
        boost::system::error_code & ec);
      » more...

Write a certain amount of data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename Allocator,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        basic_streambuf< Allocator > & b,
        CompletionCondition completion_condition,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename Allocator,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        basic_streambuf< Allocator > & b,
        CompletionCondition completion_condition,
        boost::system::error_code & ec,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

Write all of the supplied data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v2>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v2 buffers,
        constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v2>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v2 buffers,
        boost::system::error_code & ec,
        constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >  = 0);
      » more...

Write a certain amount of data to a stream before returning.

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v2,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v2 buffers,
        CompletionCondition completion_condition,
        constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

    template<
        typename SyncWriteStream,
        typename DynamicBuffer_v2,
        typename CompletionCondition>
    std::size_t write(
        SyncWriteStream & s,
        DynamicBuffer_v2 buffers,
        CompletionCondition completion_condition,
        boost::system::error_code & ec,
        constraint_t< is_dynamic_buffer_v2< DynamicBuffer_v2 >::value >  = 0,
        constraint_t< is_completion_condition< CompletionCondition >::value >  = 0);
      » more...

##### See Also

Streams, short reads and short writes

##### Requirements

Header: `boost/asio/impl/write.hpp`

Convenience header: `boost/asio.hpp`