code: public void setString(String str) throws IOException {
          Reader r = new StringReader(str);
          int    c;
          reset();
          while (((c = r.read()) != 0) && (c != -1)) {
              write(c);
          }
      }
docs: Sets the buffer contents.
  
  @param str The string to set.
  @throws java.io.IOException if any.