Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.io.PrintStream;
- import java.net.Socket;
- import java.util.Scanner;
- public class Write implements Runnable {
- String out;
- PrintStream myOutputStream;
- public Write(Socket mySocket) throws IOException {
- myOutputStream = new PrintStream(mySocket.getOutputStream());
- }
- @Override
- public void run() {
- try {
- out = new Scanner(System.in).nextLine();
- myOutputStream.println(out);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement