Here you can find the source of openWriter(Socket socket)
public static synchronized PrintWriter openWriter(Socket socket) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.PrintWriter; import java.net.Socket; public class Main { public static synchronized PrintWriter openWriter(Socket socket) throws IOException { PrintWriter writer = new PrintWriter(socket.getOutputStream(), true); return writer; }// w ww. j a v a 2 s . c om }