logger.log(Level.INFO, "Writing Unalloc file to " + currentlyProcessing.getPath()); //NON-NLS
OutputStream dos = new FileOutputStream(currentlyProcessing);
long bytes = 0;
int i = 0;
while(i < u.getLayouts().size() && bytes != u.getSizeInBytes()){
LayoutFile f = u.getLayouts().get(i);
long offsetPerFile = 0L;
int bytesRead;
while(offsetPerFile != f.getSize() && !canceled){
if (++kbs % 128 == 0) {
mbs++;
progress.progress(NbBundle.getMessage(this.getClass(),
"ExtractUnallocAction.processing.counter.msg",
mbs, totalSizeinMegs), mbs-1);
}
bytesRead = f.read(buf, offsetPerFile, MAX_BYTES);
offsetPerFile+= bytesRead;
dos.write(buf, 0, bytesRead);
}
bytes+=f.getSize();
i++;
}
dos.flush();
dos.close();