Commit ffc73f69 authored by Fabrice Marsaud's avatar Fabrice Marsaud Committed by GitHub

Merge pull request #14 from nraynaud/master

fix reading of big files
parents 0f1fcb5b 7c2ca1e9
......@@ -38,7 +38,7 @@ module.exports = function(filename, options, cb){
;
// get file length
for(var i=0;i<file.EndofFile.length;i++){
fileLength |= file.EndofFile[i] << (i*8);
fileLength += file.EndofFile[i] * Math.pow(2, i * 8);
}
var result = new Buffer(fileLength);
// callback manager
......
......@@ -24,7 +24,7 @@ class SmbReadableStream extends Readable {
let fileLength = 0
for (let i = 0; i < file.EndofFile.length; i++) {
fileLength |= file.EndofFile[i] << (i * 8)
fileLength += file.EndofFile[i] * Math.pow(2, i * 8)
}
this.fileLength = fileLength
this.wait = false
......
......@@ -10,7 +10,7 @@ export default function (path, cb) {
} else {
let fileLength = 0
for (let i = 0; i < file.EndofFile.length; i++) {
fileLength |= file.EndofFile[i] << (i * 8)
fileLength += file.EndofFile[i] * Math.pow(2, i * 8)
}
cb(null, fileLength)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment