Here is the code snippet:
StreamConnection st_connect=(StreamConnection)Connector.open(connectionURL);
OutputStream outStream=st_connect.openOutputStream();
PrintWriter pWriter=new PrintWriter(new OutputStreamWriter(outStream));
pWriter.write("Test\r\n");
From what I know OutputStream
is used with PrintStream
. If that is true, then why is a PrintWriter
reference used in this case? For your reference, this is a part of a Bluetooth Client Application based on SPP .