Changed order of assignment of outStream and inStream. Caceiro mentioned an error they had was caused by assigning the input stream before the output stream.