Is reservoir sampling unnecessary if you know the length of the stream of integers? I think I understand Reservoir Sampling.  If you have a large stream of integers then it allows you to get a sample of size k from that stream without putting it all in memory.
My question is what if you know beforehand the length of the stream?  Say the length of the stream is n.  In this case I would assume that a much simpler way to get a sample of k would be to just generate k random indices between 0 and n beforehand then as you iterate through the stream just select the integers corresponding to the indices you sampled beforehand.  What would be the downside of this? Slower maybe?
There is no particular downside. It's a perfectly valid approach.