code: public void write(final String data) throws IOException {
          if (socket != null) {
              out.write(data.getBytes());
          }
      }
docs: Sends the {@code data} specified if the connection exists