Sample code for 30+ languages & platforms
Java

Reassemble a Previously Split File

Demonstrates how to reassemble a previously split file.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.FileAccess;

public class ChilkatExample {

    public static void main(String[] args) {
        FileAccess fac = new FileAccess();

        // Any type of file may be reassembled.  It doesn't matter if it's
        // a binary file or a text file.
        String reassembledFilename = "hamlet2.xml";

        String partPrefix = "hamlet";
        String partExtension = "spl";
        String srcDirPath = ".";

        // Reassembles the original file from hamlet1.spl, hamlet2.spl, ...

        try {
            fac.reassembleFile(srcDirPath, partPrefix, partExtension, reassembledFilename);
            System.out.println("Success.");
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
        }
    }
}