There is stream (sequence) of uniform random integers $x_i$, each integer in $[0,N-1]$ range, where N is not power of 2.
I need to convert it to sequence of integers [0..255] (bytes), such that uniformity in input numbers results in uniformity in output numbers. And non-uniformity in input number results in some non-uniformity in output numbers.
I am thinking about doing $L=\sum{x_i N^{i}}$ (using multiple-precision library), then representing L in base 256 (taking bytes from L in binary). Is this good ? Is there better method ?
It may depend on what you mean by uniformity, but if you mean random and independent with a uniform distribution then you can probably move on to the next issue.
There is a problem that powers of $N$ are not powers of 256 (unless this is an infinite stream) so with your suggestion you cannot be sure that all your bytes are equally likely. There are ways around this involving rejection sampling: e.g. if $N=258$ you might simply ignore every time $256$ or $257$ appears.
If it is an infinite stream of numbers then $L$ will be infinite and it might be better to look at $\sum{x_i N^{-i}}$ written in base $256$ instead. [This illustrates the uniformity issue: there are apparently numbers which may be normal in one base but not another.]
Be aware that in any method, it is possible (though perhaps with probability zero) that you do not find out which way to round the calculation of some bytes. More realistically there is a positive though small probability you will have to wait a long time to find even a few bytes.