private static void write(SootClass sClass, int output_format) {
		OutputStream streamOut = null;
		try {
			String filename = SourceLocator.v().getFileNameFor(sClass, output_format);
			if (output_format == Options.output_format_class)
				streamOut = new JasminOutputStream(new FileOutputStream(filename));
			else
				streamOut = new FileOutputStream(filename);
			PrintWriter writerOut = new PrintWriter(new OutputStreamWriter(streamOut));
			if (output_format == Options.output_format_class) {
				JasminClass jasClass = new JasminClass(sClass);
				jasClass.print(writerOut);
			} else if (output_format == Options.output_format_jimple)
				Printer.v().printTo(sClass, writerOut);
			else if (output_format == Options.output_format_dava)
				DavaPrinter.v().printTo(sClass, writerOut);
			writerOut.flush();
			writerOut.close();
		} catch (FileNotFoundException e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		} finally {
			if (streamOut != null)
				try {
					streamOut.close();
				} catch (IOException e) {
					System.out.println(e.getMessage());
					e.printStackTrace();
				}
		}
	}