Trim read bytes from buffer while appending