Skip to content

Commit

Permalink
#250 Use Collections.sort for older Android compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-lingala committed Oct 18, 2020
1 parent 055e99e commit 00df701
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.OutputStream;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

Expand Down Expand Up @@ -73,7 +74,8 @@ long copyFile(RandomAccessFile randomAccessFile, OutputStream outputStream, long

List<FileHeader> cloneAndSortFileHeadersByOffset(List<FileHeader> allFileHeaders) {
List<FileHeader> clonedFileHeaders = new ArrayList<>(allFileHeaders);
clonedFileHeaders.sort((o1, o2) -> {
//noinspection Java8ListSort
Collections.sort(clonedFileHeaders, (o1, o2) -> {
if (o1.getFileName().equals(o2.getFileName())) {
return 0;
}
Expand Down

0 comments on commit 00df701

Please sign in to comment.