added helpers for reading/writing data packets