Switches to InputStream & OutputStream to make more portable