diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java index 254037f0556..9e256d33d85 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/Database.java @@ -170,8 +170,18 @@ public class Database { public void transferTo(FileChannel target) throws IOException { assert fLocked; - final FileChannel from= fFile.getChannel(); - from.transferTo(0, from.size(), target); + final FileChannel from= fFile.getChannel(); + long nRead = 0; + long position = 0; + long size = from.size(); + while (position < size) { + nRead = from.transferTo(position, 4096*16, target); + if (nRead == 0) { + break; // should not happen + } else { + position+= nRead; + } + } } public int getVersion() throws CoreException {