In download mode, client reads data from the socket and writes it to standard output. @throws Exception
()
| 42 | * @throws Exception |
| 43 | */ |
| 44 | private static void download() throws Exception { |
| 45 | if (inFromServer == null) { |
| 46 | inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); |
| 47 | } |
| 48 | String line; |
| 49 | while ((line = inFromServer.readLine()) != null) { |
| 50 | System.out.println(line); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * In upload mode, client reads data from its standard input device and writes it to the socket. |