Here you can find the source of mergeInto(List
Parameter | Description |
---|---|
parts | the part files to merge |
out | the stream to write each file into, in order |
Parameter | Description |
---|---|
IOException | an exception |
static void mergeInto(List<Path> parts, OutputStream out) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; public class Main { /**/* w w w.j av a 2 s . c o m*/ * Merge the given part files in order into an output stream. * This deletes the parts. * @param parts the part files to merge * @param out the stream to write each file into, in order * @throws IOException */ static void mergeInto(List<Path> parts, OutputStream out) throws IOException { for (final Path part : parts) { Files.copy(part, out); Files.delete(part); } } }