Deciding file type

You have been given a table having size of header, header and type of
file. Base on that you have to write a class which provides method to
open & read file and decide the file type.