I write a small application to merge file, current it merge text file, audio file but not work with video file. I don't know why. this's code:
Code:public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
JFileChooser F = new JFileChooser();
String[] Path = new String[2];
for(int i=0;i<=1;i++){
int t = F.showOpenDialog(null);
if(t==F.APPROVE_OPTION){
File F1 = F.getSelectedFile();
Path[i] = F1.getPath();
}
}
if(F.showSaveDialog(null)==JFileChooser.APPROVE_OPTION){
FileOutputStream out = new FileOutputStream(F.getSelectedFile());
for(int i=0; i<=1;i++){
FileInputStream F1 = new FileInputStream(Path[i]);
int n = F1.available();
while(n>0){
byte[] B = new byte[n];
int k = F1.read(B);
if(k==-1) break;
out.write(B);
}
F1.close();
}
out.close();
}
JOptionPane.showMessageDialog(null, "Merge Successful...!");
}

