Added block and file headers in encoding