public synchronized void close() {flush();if (out != null) {try {out.close();out = null;} catch (IOException e) {setError();}}}

public synchronized void close ( ) { flush ( ) ; if ( out != null ) { try { out . close ( ) ; out = null ; } catch ( IOException e ) { setError ( ) ; } } }
public override void close(){lock (this){flush();if (@out != null){try{@out.close();@out = null;}catch (System.IO.IOException){setError();}}}}
