Merge pull request #638 from hashem78/master

[Android][Bug fix]use long instead of int to represent no. of bytes  when parsing file sizes
This commit is contained in:
Miguel Ruivo 2021-03-08 19:46:05 +00:00 committed by GitHub
commit e134816489
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -8,10 +8,10 @@ public class FileInfo {
final String path;
final String name;
final int size;
final long size;
final byte[] bytes;
public FileInfo(String path, String name, int size, byte[] bytes) {
public FileInfo(String path, String name, long size, byte[] bytes) {
this.path = path;
this.name = name;
this.size = size;
@ -22,7 +22,7 @@ public class FileInfo {
private String path;
private String name;
private int size;
private long size;
private byte[] bytes;
public Builder withPath(String path){
@ -35,7 +35,7 @@ public class FileInfo {
return this;
}
public Builder withSize(int size){
public Builder withSize(long size){
this.size = size;
return this;
}

View File

@ -173,7 +173,7 @@ public class FileUtils {
fileInfo
.withPath(path)
.withName(fileName)
.withSize(Integer.parseInt(String.valueOf(file.length())));
.withSize(Long.parseLong(String.valueOf(file.length())));
return fileInfo.build();
}