code: public void write(CharSequence charSequence) throws IOException {
      checkNotNull(charSequence);
  
      Closer closer = Closer.create();
      try {
        Writer out = closer.register(openStream());
        out.append(charSequence);
        out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330
      } catch (Throwable e) {
        throw closer.rethrow(e);
      } finally {
        closer.close();
      }
    }
docs: Writes the given character sequence to this sink.
  
  @throws IOException if an I/O error while writing to this sink