Code example for FileImageOutputStream

Methods: close

0
	 
				// Set compression quality, where 1 specifies minimum compression and maximum quality 
				iwp.setCompressionQuality(compressionQuality); // float between 0 and 1
			} 
			// Write the screen shot to file  
			output = new FileImageOutputStream(file);
			writer.setOutput(output);
			IIOImage image = new IIOImage(screenshot, null, null);
 
			writer.write(null, image, iwp);
		} catch (IOException e) {
			e.printStackTrace();
		} finally { 
			if (writer != null) {
				writer.dispose();
			} 
			if (output != null) {
				try { 
					output.close();
				} catch (IOException e) {
					e.printStackTrace();
				} 
			} 
		}