/**
   * Returns true if the server has accepted this client's username, false otherwise.
   *
   * @throws IOException If an I/O error occurs.
   */
  private boolean getUserNameConfirmation() throws IOException {

    if (!Utils.isNullOrEmptyString(userName)) {
      writer.write(userName);
      writer.newLine();
      writer.flush();

      if (inputStream.read() == 1) {
        return true;
      }
    }

    return false;
  }