public PrintWriter format ( Locale l , String format , Object ... args ) { try { synchronized ( lock ) { ensureOpen ( ) ; if ( ( formatter == null ) || ( formatter . locale ( ) != l ) ) formatter = new Formatter ( WeakProxy . forObject ( this ) , l ) ; formatter . format ( l , format , args ) ; if ( autoFlush ) out . flush ( ) ; } } catch ( InterruptedIOException x ) { Thread . currentThread ( ) . interrupt ( ) ; } catch ( IOException x ) { trouble = true ; } return this ; }
Writes a formatted string to this writer using the specified format string and arguments . If automatic flushing is enabled calls to this method will flush the output buffer .