}

impl BufferPool {
    pub fn new(cap: usize) -> BufferPool {
        BufferPool { pool: Vec::with_capacity(cap) }
    }

    pub fn get(&mut self, default_cap: usize) -> Vec<u8> {
        self.pool.pop().unwrap_or_else(|| Vec::with_capacity(default_cap))