In upload mode, client reads data from its standard input device and writes it to the socket. @throws Exception
()
| 57 | * @throws Exception |
| 58 | */ |
| 59 | @SuppressWarnings("Duplicates") |
| 60 | private static void upload() throws Exception { |
| 61 | DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream()); |
| 62 | outToServer.writeBytes(new Scanner(System.in).useDelimiter("\\Z").next()); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Starts execution of the program, requiring a host name and port number as an argument. |