Way better handling of retrieving the size of a stream