mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 04:45:38 +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
|
@ -171,7 +171,17 @@ public class Database {
|
||||||
public void transferTo(FileChannel target) throws IOException {
|
public void transferTo(FileChannel target) throws IOException {
|
||||||
assert fLocked;
|
assert fLocked;
|
||||||
final FileChannel from= fFile.getChannel();
|
final FileChannel from= fFile.getChannel();
|
||||||
from.transferTo(0, from.size(), target);
|
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 {
|
public int getVersion() throws CoreException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue