Java UTF8 inputStreamToFile(final InputStream inputStream, final File outputFile)

Here you can find the source of inputStreamToFile(final InputStream inputStream, final File outputFile)

Description

Reads from an java.io.InputStream and writes to a java.io.File .

License

Open Source License

Parameter

Parameter Description
inputStream The java.io.InputStream
outputFile The java.io.File to write to

Exception

Parameter Description
IOException If an IO exception has occurred

Declaration

public static void inputStreamToFile(final InputStream inputStream, final File outputFile) throws IOException 

Method Source Code


//package com.java2s;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import java.nio.file.Files;

public class Main {
    /**//w  w w.j av a2s. c  om
     * Reads from an {@link java.io.InputStream} and writes to a {@link java.io.File}.
     * Closes the {@link java.io.InputStream} when done.
     *
     * @param inputStream The {@link java.io.InputStream}
     * @param outputFile The {@link java.io.File} to write to
     * @throws IOException If an IO exception has occurred
     */
    public static void inputStreamToFile(final InputStream inputStream, final File outputFile) throws IOException {
        Files.copy(inputStream, outputFile.toPath());
    }
}

Related

  1. getUTF8Reader(InputStream f)
  2. getUtf8String(URL url)
  3. getUTF8SuportOutput()
  4. getUTF8Writer(String path)
  5. hasLeadingWhitespace(File inputFile)
  6. isSystemUtf8()
  7. isUtf8Supported()
  8. loadStringUTF8(InputStream in)
  9. makeUTF8()