public void close(){
  flush();
  try {
    out.close();
  }
 catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}

public void close ( ) { flush ( ) ; try { out . close ( ) ; } catch ( IOException e ) { throw new IllegalStateException ( e ) ; } }
flush and close the stream . this will also close the underlying stream .
