Initialize output streams.
Throw error on invalid stream.