code: public static final void write(WritableByteChannel ch, String text, Charset charset) throws IOException
      {
          write(ch, text.getBytes(charset));
      }
docs: Writes string bytes to channel using charset.
  @param ch
  @param text
  @param charset
  @throws IOException