Detect the file type of a Buffer/Uint8Array