select random m items from a large inputstream