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:
parent
00398ac145
commit
0b6a51224f
1 changed files with 12 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue