yet another reimplementation of bytes.Buffer