writing huff file header and body