Java InputStream to File writeStreamToFile(InputStream skypeFrameworkStream, File skypeFramework)

Here you can find the source of writeStreamToFile(InputStream skypeFrameworkStream, File skypeFramework)

Description

write Stream To File

License

Apache License

Declaration

private static void writeStreamToFile(InputStream skypeFrameworkStream, File skypeFramework)
            throws FileNotFoundException, IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006-2007 Koji Hisano <hisano@gmail.com> - UBION Inc. Developer
 * Copyright (c) 2006-2007 UBION Inc. <http://www.ubion.co.jp/>
 * /*  w  w w . j  av  a2 s  .c  o  m*/
 * Copyright (c) 2006-2007 Skype Technologies S.A. <http://www.skype.com/>
 * 
 * Skype4Java is licensed under either the Apache License, Version 2.0 or
 * the Eclipse Public License v1.0.
 * You may use it freely in commercial and non-commercial products.
 * You may obtain a copy of the licenses at
 *
 *   the Apache License - http://www.apache.org/licenses/LICENSE-2.0
 *   the Eclipse Public License - http://www.eclipse.org/legal/epl-v10.html
 *
 * If it is possible to cooperate with the publicity of Skype4Java, please add
 * links to the Skype4Java web site <https://developer.skype.com/wiki/Java_API> 
 * in your web site or documents.
 * 
 * Contributors:
 * Koji Hisano - initial API and implementation
 * Bart Lamot - ExtractFormJar methods.
 * Gabriel Takeuchi - mac osx native library improvements
 ******************************************************************************/

import java.io.File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import java.io.IOException;
import java.io.InputStream;

public class Main {
    private static void writeStreamToFile(InputStream skypeFrameworkStream, File skypeFramework)
            throws FileNotFoundException, IOException {
        FileOutputStream out = new FileOutputStream(skypeFramework);
        int count;
        byte[] buffer = new byte[1024];
        while (0 < (count = skypeFrameworkStream.read(buffer))) {
            out.write(buffer, 0, count);
        }
    }
}

Related

  1. writeStreamToFile(InputStream is, File file)
  2. writeStreamToFile(InputStream is, File out)
  3. writeStreamToFile(InputStream is, File toFile)
  4. writeStreamToFile(InputStream is, String fileName)
  5. writeStreamToFile(InputStream is, String path)
  6. writeStreamToFile(InputStream stream, File file)
  7. writeStreamToFile(String chemin, String contenu)