Here you can find the source of writeDatasIntoSocket(Socket socket, String datas)
public static void writeDatasIntoSocket(Socket socket, String datas) throws IOException
//package com.java2s; //License from project: Apache License import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; public class Main { public static void writeDatasIntoSocket(Socket socket, String datas) throws IOException { DataOutputStream dos = new DataOutputStream(socket.getOutputStream()); dos.writeBytes(datas);/*from w w w. ja v a 2s . c o m*/ dos.flush(); } }