fix to-input-stream