Here you can find the source of writeUTF(final Socket socket, final String out)
static int writeUTF(final Socket socket, final String out)
//package com.java2s; //License from project: Open Source License import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; public class Main { static int writeUTF(final Socket socket, final String out) { //Logger.logD("enter trace"); if (out != null) { //Logger.logD("out != null"); if (socket != null) { //Logger.logD("socket != null"); try { //Logger.logD("getting dos"); DataOutputStream dos = new DataOutputStream(socket.getOutputStream()); //Logger.logD("got dos"); //Logger.logD("performing write"); dos.writeUTF(out);/*w w w . j a v a2 s . c o m*/ //Logger.logD("performing flush"); dos.flush(); //Logger.logD("exit trace"); return 0; } catch (IOException e) { e.printStackTrace(); //Logger.logD("exit trace"); return -3; } } //Logger.logD("exit trace"); return -2; } //Logger.logD("exit trace"); return -1; } }