Java Path File List nio mergeInto(List parts, OutputStream out)

Here you can find the source of mergeInto(List parts, OutputStream out)

Description

Merge the given part files in order into an output stream.

License

Open Source License

Parameter

Parameter Description
parts the part files to merge
out the stream to write each file into, in order

Exception

Parameter Description
IOException an exception

Declaration

static void mergeInto(List<Path> parts, OutputStream out) throws IOException 

Method Source Code


//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);
        }
    }
}

Related

  1. listOfWords(String filePath)
  2. listSteps(Path scenarioDirectory)
  3. loadDataFilesList(String prefix, Path bwcIndicesPath)
  4. loadTrainingData(Path path, List input, List output, int outputCount)
  5. mergeFiles(List files, Path mergedFile)
  6. pathContainsAny(List strings)
  7. recursiveListFiles(Path file)
  8. recusivelyCollectFileListing(ArrayList rc, Path base, Path directory)
  9. registerRecursive(final WatchService watcher, final List startingPaths)