Find larger of two numbers represented as a stream of two integers, with most significant digit appearing first in the stream?

Ex -

Input

Stream A → 1,2,3

Stream B → 1,0,5

Output

Stream A (123)is greater than B(105).

Each element in both the streams will be in the range 0<=ele<=9

Comparing digit by digit from the leftmost element works assuming leftmost element is non zero.

Now, what if the stream is continuous or originating from a web service dumping huge integers in these two streams? I.E Upper bound on both the streams is large of the order 10^18. What can be the efficient approach?