port simple-stream helpers