I've got some data that is coming in through a byte stream. I want to determine its file type so I know how to parse it. At present, I'm only concerned about HTML or Images, everything else can be discarded.
What's an efficient method of differentiating between the two? And what if I want to expand this to include other file types?