PrintWriter
ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(bos, StandardCharsets.UTF-8);
PrintWriter pw = new PrintWriter(osw);
ServerSocker
ServerSocket serverSocket = new ServerSocket(55888);
Socket socket = serverSocket.accept();
InputStream is = socket.getInputStream();
OutputStream os = socket.getOutputStream();
Socket socket = new Socket();
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 55888);
socket.connect(address);
InputStream is = socket.getInputStream();
OutputStream os = socket.getOutputStream();