512 bytes should be enough to figure out if a file is binary or not.