code: public PrintStream format(String format, Object ... args) {
          try {
              synchronized (this) {
                  ensureOpen();
                  if ((formatter == null)
                      || (formatter.locale() != Locale.getDefault()))
                      formatter = new Formatter((Appendable) WeakProxy.forObject(this));
                  formatter.format(Locale.getDefault(), format, args);
              }
          } catch (InterruptedIOException x) {
              Thread.currentThread().interrupt();
          } catch (IOException x) {
              trouble = true;
          }
          return this;
      }
docs: Writes a formatted string to this output stream using the specified
  format string and arguments.
  
  <p> The locale always used is the one returned by {@link
  java.util.Locale#getDefault() Locale.getDefault()}, regardless of any
  previous invocations of other formatting methods on this object.
  
  @param  format
  A format string as described in <a
  href="../util/Formatter.html#syntax">Format string syntax</a>
  
  @param  args
  Arguments referenced by the format specifiers in the format
  string.  If there are more arguments than format specifiers, the
  extra arguments are ignored.  The number of arguments is
  variable and may be zero.  The maximum number of arguments is
  limited by the maximum dimension of a Java array as defined by
  <cite>The Java&trade; Virtual Machine Specification</cite>.
  The behaviour on a
  <tt>null</tt> argument depends on the <a
  href="../util/Formatter.html#syntax">conversion</a>.
  
  @throws  java.util.IllegalFormatException
  If a format string contains an illegal syntax, a format
  specifier that is incompatible with the given arguments,
  insufficient arguments given the format string, or other
  illegal conditions.  For specification of all possible
  formatting errors, see the <a
  href="../util/Formatter.html#detail">Details</a> section of the
  formatter class specification.
  
  @throws  NullPointerException
  If the <tt>format</tt> is <tt>null</tt>
  
  @return  This output stream
  
  @since  1.5