code: public void writeChars(String pString) throws IOException {
          int length = pString.length();
  
          for (int i = 0; i < length; i++) {
              int c = pString.charAt(i);
              out.write(c & 0xFF);
              out.write((c >>> 8) & 0xFF);
          }
  
          bytesWritten += length * 2;
      }
docs: Writes a string to the underlying output stream as a sequence of
  characters. Each character is written to the data output stream as
  if by the {@code writeChar} method.
  
  @param pString a {@code String} value to be written.
  @throws IOException if the underlying stream throws an IOException.
  @see #writeChar(int)
  @see #out