1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Exporting index-databases larger than 1GB, bug 239462.

This commit is contained in:
Markus Schorn 2008-07-09 08:27:48 +00:00
parent 00398ac145
commit 0b6a51224f

View file

@ -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 {