Change char* buffer to vector for read/write commands