public OutputStream provideOutputStream() {
			if (stream == null) {
				try {
					File f = new File(System.getProperty("snapshot.path", "./snapshot-" + datetime() + '-' + randomNumber()));
					stream = new FileOutputStream(f);
					Runtime.getRuntime().addShutdownHook(new Thread() {
						@Override
						public void run() {
							try {
								stream.close();
							} catch (IOException ex) {
								throw new RuntimeException(ex);
							}
						}
					});
				} catch (IOException ex) {
					throw new RuntimeException(ex);
				}
			}
			return stream;
		}