Implement decodeFile/decodeFileHeader