stream-mmmagic

sniff the start of a stream (non-destructively) to detect the file type and encoding