Here you can find the source of saveTemp(final byte[] data, final String suffix)
private static File saveTemp(final byte[] data, final String suffix) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { private static File saveTemp(final byte[] data, final String suffix) throws IOException { final File tempFile = File.createTempFile("afirma", suffix); //$NON-NLS-1$ tempFile.deleteOnExit();// ww w .j a v a2 s. c om if (saveFile(tempFile, data)) { return tempFile; } return null; } private static boolean saveFile(final File file, final byte[] dataToSave) throws IOException { final FileOutputStream fos = new FileOutputStream(file); fos.write(dataToSave); fos.close(); return true; } }