将文本写入套接字
import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.Socket;/*来自 时 代 J a v a*/ public class Main { public static void main(String[] argv) { try { Socket socket = null; BufferedWriter wr = new BufferedWriter(new OutputStreamWriter( socket.getOutputStream())); wr.write("aString"); wr.flush(); } catch (IOException e) { } } }