let compress function use streams