@Override
	public static void writeFile(			IFile file, final FileOutput output, IProgressMonitor monitor)			throws IOException, CoreException {		PipedInputStream pin = new PipedInputStream();		final PipedOutputStream pout = new PipedOutputStream();				// Create a thread to write bug collection to output stream		Thread worker = new Thread() {			public void run() {				try {					//bugCollection.writeXML(pout, findbugsProject);					output.writeFile(pout);				} catch (IOException e) {					FindbugsPlugin.getDefault().logException(							e, "Exception while " + output.getTaskDescription());				} finally {					try {						pout.close();					} catch (IOException e) {						// ignore					}				}			}		};						try {			pin.connect(pout);			worker.start();									if (!file.exists())				file.create(pin, true, monitor);			else				file.setContents(pin, true, false, monitor);						// Need to refresh here?			file.refreshLocal(IResource.DEPTH_INFINITE, monitor);		} finally {			try {				pin.close();			} catch (IOException e) {				// ignore			}		}			}