Deduplicates a stream of data.