code: private static BufferedWriter bufferOutput( Writer writer )
      {
          BufferedWriter out;
          if( writer instanceof BufferedWriter )
          {
              out = (BufferedWriter) writer;
          }
          else
          {
              out = new BufferedWriter( writer );
          }
          return out;
      }
docs: Wraps the Writer in a BufferedWriter, unless it already is a BufferedWriter.
  
  @param writer The Writer to check and possibly wrap.
  
  @return A BufferedWriter.