Calculate the checksum and size of a stream