code: public final void client(Parameters parameters) {
      String host = parameters.getHost();
      String port = parameters.getPort();
      try (Socket socketClient = new Socket(host, Integer.parseInt(port));
          BufferedReader inFromUser = new BufferedReader(
              new InputStreamReader(System.in, "UTF-8"));
          BufferedWriter outToUser = new BufferedWriter(
              new OutputStreamWriter(System.out, "UTF-8"));
          BufferedWriter outToServer = new BufferedWriter(
              new OutputStreamWriter(socketClient.getOutputStream(), "UTF-8"));
          BufferedReader inFromServer = new BufferedReader(
              new InputStreamReader(socketClient.getInputStream(), "UTF-8"));) {
  
        // send data to server socket
        StringBuilder inText = new StringBuilder();
        String line;
        while ((line = inFromUser.readLine()) != null) {
          inText.append(line).append("\n");
        }
        inText.append("<ENDOFDOCUMENT>").append("\n");
        outToServer.write(inText.toString());
        outToServer.flush();
  
        // get data from server
        StringBuilder sb = new StringBuilder();
        String kafString;
        while ((kafString = inFromServer.readLine()) != null) {
          sb.append(kafString).append("\n");
        }
        outToUser.write(sb.toString());
      } catch (UnsupportedEncodingException e) {
        // this cannot happen but...
        throw new AssertionError("UTF-8 not supported");
      } catch (UnknownHostException e) {
        LOG.error("ERROR: Unknown hostname or IP address!");
        System.exit(1);
      } catch (NumberFormatException e) {
        LOG.error("Port number not correct!");
        System.exit(1);
      } catch (IOException e) {
        LOG.error("Exception", e);
      }
    }
docs: The client to query the TCP server for annotation.
  
  @param parameters the parameters