@Override
  public void writeBytes(final @NotNull String str) {
    // if (logger.isTraceEnabled()) logger.trace(" bytes={}", str);

    if (overflowBuf != null) {
      overflowBuf.writeBytes(str);
      return;
    }
    int strlen = str.length();
    if (strlen > 0) {
      for (int i = 0; i < strlen; i++) {
        writeByte((byte) str.charAt(i));
      }
    }
  }
Writes a string to the output stream. For every character in the string <code>s</code>, taken
in order, one byte is written to the output stream. If <code>s</code> is <code>null</code>, a
<code>NullPointerException</code> is thrown.
<p>
If <code>s.length</code> is zero, then no bytes are written. Otherwise, the character
<code>s[0]</code> is written first, then <code>s[1]</code>, and so on; the last character
written is <code>s[s.length-1]</code>. For each character, one byte is written, the low-order
byte, in exactly the manner of the <code>writeByte</code> method . The high-order eight bits of
each character in the string are ignored.

@param str the string of bytes to be written.
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgStreamer.java