code: public void writeBytes(String pString) throws IOException {
          int length = pString.length();
  
          for (int i = 0; i < length; i++) {
              file.write((byte) pString.charAt(i));
          }
      }
docs: Writes a string to the underlying output stream as a sequence of
  bytes. Each character is written to the data output stream as
  if by the {@code writeByte()} method.
  
  @param pString the {@code String} value to be written.
  @throws IOException if the underlying stream throws an IOException.
  @see #writeByte(int)
  @see #file