mirror of
https://github.com/wrwrabbit/Partisan-Telegram-Android.git
synced 2026-05-03 06:20:11 +00:00
Update to 5.4.0
This commit is contained in:
parent
f338a88eb4
commit
e397bd9afd
200 changed files with 16433 additions and 7823 deletions
|
|
@ -23,7 +23,7 @@ import java.io.IOException;
|
|||
import java.io.RandomAccessFile;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
public class FileStreamLoadOperation extends BaseDataSource {
|
||||
public class FileStreamLoadOperation extends BaseDataSource implements FileLoadOperationStream {
|
||||
|
||||
private FileLoadOperation loadOperation;
|
||||
|
||||
|
|
@ -76,8 +76,10 @@ public class FileStreamLoadOperation extends BaseDataSource {
|
|||
}
|
||||
opened = true;
|
||||
transferStarted(dataSpec);
|
||||
file = new RandomAccessFile(loadOperation.getCurrentFile(), "r");
|
||||
file.seek(currentOffset);
|
||||
if (loadOperation != null) {
|
||||
file = new RandomAccessFile(loadOperation.getCurrentFile(), "r");
|
||||
file.seek(currentOffset);
|
||||
}
|
||||
return bytesRemaining;
|
||||
}
|
||||
|
||||
|
|
@ -96,9 +98,8 @@ public class FileStreamLoadOperation extends BaseDataSource {
|
|||
while (availableLength == 0) {
|
||||
availableLength = loadOperation.getDownloadedLengthFromOffset(currentOffset, readLength);
|
||||
if (availableLength == 0) {
|
||||
if (loadOperation.isPaused()) {
|
||||
FileLoader.getInstance(currentAccount).loadStreamFile(this, document, parentObject, currentOffset);
|
||||
}
|
||||
FileLog.d("not found bytes " + offset);
|
||||
FileLoader.getInstance(currentAccount).loadStreamFile(this, document, parentObject, currentOffset);
|
||||
countDownLatch = new CountDownLatch(1);
|
||||
countDownLatch.await();
|
||||
}
|
||||
|
|
@ -142,7 +143,8 @@ public class FileStreamLoadOperation extends BaseDataSource {
|
|||
}
|
||||
}
|
||||
|
||||
protected void newDataAvailable() {
|
||||
@Override
|
||||
public void newDataAvailable() {
|
||||
if (countDownLatch != null) {
|
||||
countDownLatch.countDown();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue