Java Socket Write createWriter(Socket socket)

Here you can find the source of createWriter(Socket socket)

Description

create Writer

License

Open Source License

Declaration

public static PrintWriter createWriter(Socket socket) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.PrintWriter;

import java.io.OutputStreamWriter;

import java.net.Socket;

public class Main {
    public static PrintWriter createWriter(Socket socket) throws IOException {
        return new PrintWriter(socket.getOutputStream());
    }//from ww  w . j  a va  2  s. c  o  m

    public static PrintWriter createWriter(Socket socket, String charset) throws IOException {
        OutputStreamWriter osw = new OutputStreamWriter(socket.getOutputStream(), charset);
        return new PrintWriter(osw);
    }
}

Related

  1. copy(final Socket inputSocket, final Socket outputSocket)
  2. createObjectOutputStream(Socket socket)
  3. getOutputStream(Socket socket)
  4. getOutputStreamFromSocket(final Socket socket)
  5. getWriter(Socket socket)
  6. openWriter(Socket socket)