Simplify implementation of native stream redirection.