parse buffer