Here you can find the source of write(InputStream in, Path path, StandardCopyOption op)
write.
Parameter | Description |
---|---|
in | a java.io.InputStream object. |
path | a java.nio.file.Path object. |
op | a java.nio.file.StandardCopyOption object. |
public static void write(InputStream in, Path path, StandardCopyOption op)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; public class Main { /**//from ww w. j a v a 2s . c o m * <p>write.</p> * * @param in a {@link java.io.InputStream} object. * @param path a {@link java.nio.file.Path} object. */ public static void write(InputStream in, Path path) { write(in, path, StandardCopyOption.REPLACE_EXISTING); } /** * <p>write.</p> * * @param in a {@link java.io.InputStream} object. * @param file a {@link java.io.File} object. */ public static void write(InputStream in, File file) { write(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); } /** * <p>write.</p> * * @param in a {@link java.io.InputStream} object. * @param path a {@link java.nio.file.Path} object. * @param op a {@link java.nio.file.StandardCopyOption} object. */ public static void write(InputStream in, Path path, StandardCopyOption op) { try { Files.copy(in, path, op); } catch (IOException e) { throw new RuntimeException(e); } } }