pub fn with_capacity(size: usize) -> BytesMut
Expand description
Create a BytesMut and initialize it according to the capacity. The created buffer contains the initialization message header required for message encoding, which is an optimization to reduce data copying in the process.