use bytestream in both directions...works for files not too large, does not work for ssl