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

View File

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