if (componentStreams[i] == null) {
componentStreams[i] = new InputStreamWrapper(
new FileInputStream(componentFiles[i]));
}
InputStreamInterface instream = componentStreams[i];
while (true) {
int count = instream.read(writeBuffer, 0, writeBuffer.length);
if (count <= 0) {
break;
}
fileOut.write(writeBuffer, 0, count);
}
instream.close();
fileOut.flush();
fileOut.getFD().sync();
} finally {
if (fileOut != null) {
fileOut.close();