Java InputStream Copy nio copy(InputStream stream, File file)

Here you can find the source of copy(InputStream stream, File file)

Description

copy

License

Open Source License

Declaration

private static void copy(InputStream stream, File file) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

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

import java.nio.file.Files;

import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class Main {
    private static void copy(InputStream stream, File file) throws IOException {
        Files.copy(stream, Paths.get(file.toURI()), StandardCopyOption.REPLACE_EXISTING);
    }//from  w  w w .  ja  v a  2s  . c o m
}

Related

  1. copy(InputStream input, OutputStream output)
  2. copy(InputStream input, OutputStream output)
  3. copy(InputStream input, OutputStream output)
  4. copy(InputStream input, OutputStream output)
  5. copy(InputStream src, File dst)
  6. copyStream(final InputStream aInStream, final OutputStream aOutStream)
  7. copyStream(final InputStream in)
  8. copyStream(final InputStream is, final OutputStream os)
  9. copyStream(InputStream in, OutputStream out)