Is there an algorithm to achieve optimal compression in a "streamed" manner, assuming equal probability of each possibility?
However, this requires having access to all of the data at once in order to decompress it.


Not true. The trick is to compress backwards, from the last symbol, to the first. You do need all the data at once to compress though.

However, what you are looking for can be done with arithmetic coding, without even needing access to all of the data at once during compression.