pub fn with_capacity(cap: usize, inner: W) -> Self {
        Self { inner, buf: Vec::with_capacity(cap), written: 0 }
    }
Creates a new `BufWriter` with the specified buffer capacity.
futures-util/src/io/buf_writer.rs