private static BufferedWriter ensureBuffered ( Writer wtr ) { if ( wtr == null ) throw new NullPointerException ( "Provided writer was null" ) ; return wtr instanceof BufferedWriter ? ( BufferedWriter ) wtr : new BufferedWriter ( wtr ) ; }
Ensures a writer is buffered .