Advertisement
Guest User

Untitled

a guest
Jun 9th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.io.IOException;
  2. import java.io.PrintStream;
  3. import java.net.Socket;
  4. import java.util.Scanner;
  5.  
  6. public class Write implements Runnable {
  7.     String out;
  8.     PrintStream myOutputStream;
  9.  
  10.     public Write(Socket mySocket) throws IOException {
  11.         myOutputStream = new PrintStream(mySocket.getOutputStream());
  12.     }
  13.  
  14.     @Override
  15.     public void run() {
  16.         try {
  17.             out = new Scanner(System.in).nextLine();
  18.             myOutputStream.println(out);
  19.         } catch (Exception e) {
  20.             e.printStackTrace();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement