read and write msg to parcel