Convert buffer output to string