为什么PrintWriter在此代码段中用于蓝牙SPP通信?

时间:2013-08-24 17:24:55

标签: java bluetooth printwriter spp

以下是代码段:

StreamConnection st_connect=(StreamConnection)Connector.open(connectionURL);
OutputStream outStream=st_connect.openOutputStream();
PrintWriter pWriter=new PrintWriter(new OutputStreamWriter(outStream));
pWriter.write("Test\r\n");

据我所知,OutputStreamPrintStream一起使用。如果这是真的,那么为什么在这种情况下使用PrintWriter引用呢?供您参考,这是基于SPP的蓝牙客户端应用程序的一部分。

0 个答案:

没有答案
相关问题