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:
commit
e134816489
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue