Java Socket Write writeOutputStream(Socket socket, StringBuffer sb)

Here you can find the source of writeOutputStream(Socket socket, StringBuffer sb)

Description

write Output Stream

License

Open Source License

Declaration

public static void writeOutputStream(Socket socket, StringBuffer sb) throws IOException 

Method Source Code


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

import java.io.*;
import java.net.Socket;

public class Main {
    public static void writeOutputStream(Socket socket, StringBuffer sb) throws IOException {
        PrintWriter writer = getPrintWriterFromOutputStream(socket);
        writer.write(sb.toString());//  w ww.  ja  v a2  s  . c  o m
        writer.flush();
    }

    private static PrintWriter getPrintWriterFromOutputStream(Socket socket) throws IOException {
        return new PrintWriter(socket.getOutputStream());
    }
}

Related

  1. getWriter(Socket socket)
  2. openWriter(Socket socket)
  3. writeData(Socket id, byte[] data, int len)
  4. writeDatasIntoSocket(Socket socket, String datas)
  5. writeFromServer(Socket sck, String row)
  6. writeUTF(final Socket socket, final String out)