read all data into memory