stefanwagner
Programmer
I have to append some files together.
The easy description looks like that:
On linux I may say:
cat f.1 f.2 > f.3
On dos i may say
copy -b f.1 + f.2 f.3
Is there an easy way to do something like that in java?
The real description is, that I have to put a String between,
so in pseudocode it is:
file.c = file.a + " some text " + file.b
Of course I can write 'some text' to file.d and use method one if there is one.
And of course I could read file.a, write it to file.c, append text 'some text', read file.b and append it to file.c.
This looks a little bit ugly to me and might be inefficient.
I looked at File, FileChannel, FileWriter and FileOutputStream, but there seems to be nothing close to my Problem.
I remember that this things where easy with c/ c++, but platformdependend of course.
The easy description looks like that:
On linux I may say:
cat f.1 f.2 > f.3
On dos i may say
copy -b f.1 + f.2 f.3
Is there an easy way to do something like that in java?
The real description is, that I have to put a String between,
so in pseudocode it is:
file.c = file.a + " some text " + file.b
Of course I can write 'some text' to file.d and use method one if there is one.
And of course I could read file.a, write it to file.c, append text 'some text', read file.b and append it to file.c.
This looks a little bit ugly to me and might be inefficient.
I looked at File, FileChannel, FileWriter and FileOutputStream, but there seems to be nothing close to my Problem.
I remember that this things where easy with c/ c++, but platformdependend of course.