日期:2014-05-19  浏览次数:20724 次

谁能给我解释下,这个PrintWriter把SSLSocket输出到了哪?
如下代码所示,SSLSocket是接受到的信息包。bis和bos是不是分别接受信息和把信息返回给发送方?比如SSLSocket是从192.168.0.2上发过来的,bis接受发送的数据,bos将信息发送回192.168.0.2?

Java code

SSLSocket socket = (SSLSocket) serverSocket.accept();//接受信息包

InputStream input = null;
OutputStream output = null;
BufferedReader bis = null;
PrintWriter bos = null;

input = socket.getInputStream();
output = socket.getOutputStream();

bis = new BufferedReader(new InputStreamReader(input,"utf-8"));
bos = new PrintWriter(new BufferedWriter(new OutputStreamWriter(output, "utf-8")));



------解决方案--------------------
LZ自己都给出答案了,bis接受192.168.0.2发过来的数据,bos将信息发送回192.168.0.2