Convert header to network byte order when writing, convert back to host
when reading.