updated inputstream to generate random data from a given slice