public static File copy ( InputStream stream ) throws IOException { File file = createTempFile ( ) ; copy ( stream , new FileOutputStream ( file ) ) ; return file ; }
Binary copy to temporary file . Be aware that temporary file is removed at JVM exit .