Introduced io::redirect.

Review: https://reviews.apache.org/r/21998