Skip to content

Commit 5a89406

Browse files
author
YangSen-qn
committed
change read log info logic
1 parent 53695ce commit 5a89406

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/src/main/java/com/qiniu/android/collect/UploadInfoCollector.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,14 @@ private byte[] getLogData(File recordFile){
287287
return null;
288288
}
289289

290+
int fileSize = (int)recordFile.length();
290291
RandomAccessFile randomAccessFile = null;
291292
byte[] data = null;
292293
try {
293294
randomAccessFile = new RandomAccessFile(recordFile, "r");
294-
ByteArrayOutputStream out = new ByteArrayOutputStream();
295+
ByteArrayOutputStream out = new ByteArrayOutputStream(fileSize);
295296
int len = 0;
296-
byte[] buff = new byte[3096];
297+
byte[] buff = new byte[fileSize];
297298
while ((len = randomAccessFile.read(buff)) >= 0){
298299
out.write(buff, 0, len);
299300
}

0 commit comments

Comments
 (0)